Tuesday, April 24, 2012

Move / Copy files with exception in UNIX.

The syntax :
mv [!filename]* target.
ie:
In directory "y" you have these files :
-rw-r--r-- 1 sirap sirap 0 2010-03-25 11:40 1
-rw-r--r-- 1 sirap sirap 0 2010-03-25 11:40 2 
-rw-r--r-- 1 sirap sirap 0 2010-03-25 11:40 3
-rw-r--r-- 1 sirap sirap 0 2010-03-25 11:40 4 

 You want to move all files except file "4" to directory "z".
The syntax should look like this :
# mv [!4]* ../z/ Done.

No comments:

Post a Comment