PDA

View Full Version : Unix help




dukebound85
Sep 20, 2006, 08:40 PM
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



janey
Sep 20, 2006, 08:43 PM
if you have two commands, separate them with semicolons into one line. should work :D


stupid me confused the two. :(

dukebound85
Sep 20, 2006, 08:56 PM
if you have two commands, separate them with commas into one line. should work :D


Wow is it really that simple?

rtharper
Sep 20, 2006, 09:11 PM
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..

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

dukebound85
Sep 20, 2006, 09:29 PM
uhh, it's USUALLY a semicolon in every shell i've worked on..

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
Sep 20, 2006, 09:34 PM
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 ;)

janey
Sep 20, 2006, 09:46 PM
uhh, it's USUALLY a semicolon in every shell i've worked on..
Argh i had a brainfart.
yeah, it's a semicolon, garrrr. :( :mad: :mad:

dukebound85
Sep 20, 2006, 09:49 PM
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!

dogbone
Sep 21, 2006, 02:51 AM
...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.

rtharper
Sep 21, 2006, 04:22 PM
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

dukebound85
Sep 21, 2006, 04:47 PM
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

Fairly
Sep 24, 2006, 05:55 PM
mkdir office; mv *.doc *.xls ./office/
The slash on the end is redundant. Apache uses that for web access, but this is hardly web access.

louiek
Sep 24, 2006, 06:54 PM
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.