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

dukebound85

macrumors Core
Original poster
Jul 17, 2005
19,160
4,152
5045 feet above sea level
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
 

rtharper

macrumors regular
Sep 6, 2006
201
0
Oxford, UK
janey said:
if you have two commands, separate them with commas into one line. should work :D

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

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

dukebound85

macrumors Core
Original poster
Jul 17, 2005
19,160
4,152
5045 feet above sea level
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?
 

rtharper

macrumors regular
Sep 6, 2006
201
0
Oxford, UK
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 ;)
 

dukebound85

macrumors Core
Original poster
Jul 17, 2005
19,160
4,152
5045 feet above sea level
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

macrumors regular
Sep 6, 2006
201
0
Oxford, UK
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 :p
 

louiek

macrumors 6502
Mar 7, 2006
350
62
Knutters Knoll, Melbourne
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.