Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dukebound85

macrumors Core
Original poster
How do I make a directory "office" in my cwd and move all .doc and .xls file into it from the current directory.


I can do it in 2 but was wondering if it can be done in one line


Thanks for any help. You guys are awesome
 
if you have two commands, separate them with semicolons into one line. should work 😀


stupid me confused the two. 🙁
 
janey said:
if you have two commands, separate them with commas into one line. should work 😀

uhh, it's USUALLY a semicolon in every shell i've worked on..

Code:
mkdir office; mv *.doc *.xls ./office/
 
rtharper said:
uhh, it's USUALLY a semicolon in every shell i've worked on..

Code:
mkdir office; mv *.doc *.xls ./office/


thanks that definitly works!

so in general, to execute more than one command in a sequential order, you just seperate with semi-colons?
 
dukebound85 said:
thanks that definitly works!

so in general, to execute more than one command in a sequential order, you just seperate with semi-colons?

you got it, yo ucan execute an infinite number of commands on one line by just separating them with semicolons.

I love seeing someone that still takes the time to learn the commandline. It's still my preferred way to tell a computer what to do. You won't ever find my machine on without a commandline window open 😉
 
rtharper said:
you got it, yo ucan execute an infinite number of commands on one line by just separating them with semicolons.

I love seeing someone that still takes the time to learn the commandline. It's still my preferred way to tell a computer what to do. You won't ever find my machine on without a commandline window open 😉


Yea, I am finding it to be alot more flexible than using a gui. There is so much you can do it seems.

I wouldn't be suprised if I too will start using the command line over the gui ever so slowly!
 
rtharper said:
...you can execute an infinite number of commands on one line by just separating them with semicolons.

However you would not be able to 'execute' because you'd never finish typing in the infinite number of commands.

Sorry I just had to say that. I'll go away now.
 
dogbone said:
However you would not be able to 'execute' because you'd never finish typing in the infinite number of commands.

Sorry I just had to say that. I'll go away now.

I kinda hate you right now 😛
 
dogbone said:
However you would not be able to 'execute' because you'd never finish typing in the infinite number of commands.

Sorry I just had to say that. I'll go away now.


haha nice
 
Not quite infinite. If you type "getconf ARG_MAX" it tells you the number of bytes of args + environ for exec(). I think even "ls *" will fail for a sufficiently large number of files, I know tar does.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.