Posts Tagged With: xargs

Copy all Txt Files

Tagged with: , , , , , ,

Find and copy all files with ‘.txt’ extention from a directory to another


find /home/binnyva -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents
No Comments »

Commit All Changes in Git

Tagged with: , , , , ,

Telling Git when you’ve added, deleted and renamed files gets tedious. Use this command and Git will look at the files in the current directory and work everything out for itself. The -z and -0 options prevent ill side-effects from filenames containing strange characters.


git-ls-files -d -m -o -z | xargs -0 git-update-index --add --remove

Original Article

No Comments »