Results 1 to 5 of 5
Hello
Through the commandline I would like to move multiple files to another directory.
Without using the command mv n'th times. Is it possible to pipe a list to the ...
- 06-16-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 21
moving multiple files at once
Hello
Through the commandline I would like to move multiple files to another directory.
Without using the command mv n'th times. Is it possible to pipe a list to the mv command?
Or using grep or something. For example I have a directory with 9999 files. I want to move
al the files beginning with a; c; e; and t to an other directory. What are my possibilities?
I prefer only to type one sentence in the command line. Do you guy's have good ideas.
I would really appriciate it.
P.S. My apologies, for my english
Thanks
- 06-16-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Find Examples
How to apply a unix command to a set of file (-exec).
find . -name "rc.conf" -exec chmod o+r '{}' \;
This command will search in the current directory and all sub directories. All files named rc.conf will be processed by the chmod -o+r command. The argument '{}' inserts each found file into the chmod command line. The \; argument indicates the exec command line has ended.
The end results of this command is all rc.conf files have the other permissions set to read access (if the operator is the owner of the file).
- 06-16-2009 #3Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
You can use wildcard matching call glob. For your example the command would look something like this:
Code:mv [acet]* /path/to/dest/
- 06-16-2009 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
- 06-17-2009 #5Just Joined!
- Join Date
- Jun 2009
- Posts
- 21
Thanks
I will exercise on both possibilities.


Reply With Quote
