Results 1 to 4 of 4
I already know how to move 1 or more files at the same time from 1 folder to another and how to move a single folder from 1 directory to ...
- 10-30-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 67
Using multiple commands in a single command
I already know how to move 1 or more files at the same time from 1 folder to another and how to move a single folder from 1 directory to another. But, I'm now trying to see if and how I can perform multiple steps in a command using command line. So, I have 3 questions. Using the command line....
1) If possible, what is the command to move 2 or more folders from 1 directory to another at the same time? (assume folders have similar names and completely different names)
and to take it a step further, 2) If I wanted to make a new folder in another directory to put those 2+ folders in, what is the command to make the folder while those 2+ folders are in process of moving to that new folder? (again, assume folders have similiar and completely different names) If that's even possilbe to do.
And 3) Is it possible to join multiple commands together even if they have nothing in common? For example, if I wanted to make a new folder in /root directory, then move a file from 1 folder to another (nothing to do with the /root directory) and then delete a file in another directory (nothing to do with /root or the folders I just moved the file to and from), how would I go about joining those commands? Is there a certain symbol I can use like: | ; : & <-- or anything that can join the commands together?
I've already tried some google searches but came up empty handed so I've come here. I appreciate any help. Thanks to all who answer.
- 10-31-2008 #2
try && for combining commands
or you can make pipes with ´|´ like
to see all process containing ´mv´ letters in it.ps aux | grep mv
- 10-31-2008 #3
You can use &&. && will execute the second command if the first one succeeds. If you need to relate the two processes somehow, the pipe operator that the previous poster mentioned will work. The pipe operator sends the stdout of the first command into the stdin of the second. However, if the pipe breaks (i.e. the first command failed), the second command will not be executed. But for two independent processes, && should work fine.
- 11-01-2008 #4Just Joined!
- Join Date
- Sep 2008
- Posts
- 67
Thanks for the help guys, really appreciate it. But stil curious about moving multiple folders at the same time into a single destination folder in a single command. How is that command setup?


Reply With Quote

