Copying directories
How can I copy all directories except one which name is known?
All directories is on the same level. Please help |
Try:
for i in ./* do if [ "$i" != "known_dir" ]; then cp -a $i /destination fi done Forgive me if I misunderstood. HTH, vfs |
thanks
|
Hi,
If your containing directory is not too large, you can also type cp -a [ESC]* Destination... at the time you type [ESC]*, it expanded (with bash) in the name of all the contained file and folders, then you remove the one you don't want from the list. Another way, which uses grep is by using the cpio command : find . | grep -v '/dir_name_you_don_t_want/' | cpio -pdumV dest_dir |
All times are GMT -5. The time now is 04:57 PM. |