//View Tip #673
Similar Tips
There are no more tips with these tags. Perhaps you'd like to submit one, or browse the archives.


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The command below can be used to backup all files in a directory

IFS=$'\n';for file in *; do cp ${file}{,.bak}; done

Quick explanation:
1. Set IFS - This allows for files with spaces in their name.
2. Use all files (*) - Change this to only backup certain files.
3. Use expansion to copy each file from 'filename' to 'filename.bak'

View Comments »


Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit