Pages

lundi 5 novembre 2012

list/find/scp only files or only directories

----- to find only the files, not any directory:
ls -p | grep -v /

----- to copy only the files in the current path to a server of distance , not copying any directory
set files =  `ls -p | grep -v / `
scp $files user@servername:path2copy/

----- to find only directories, not any file
ls -p | grep /



Aucun commentaire:

Enregistrer un commentaire