How To: Renaming files on the command line
Aug 21, 2009, 22:34 (1 Talkback[s])
[ Thanks to Ian
MacGregor for this link. ]
"Among the choices you have are opening a GUI
application, renaming each file manually using a file manager or
renaming the files all at one time right from the command line. GUI
applications are great and can help you get the needed work done
and manually renaming a batch of files in a file manager can take
some time. However, if you are already working on the command line,
in a console or just want to get the work done fast, there is a
quick and easy method of renaming files.
"The method I am going to show you today is as follows:
j=1; for i in *; do mv "$i" File$j; j=$((j+1)); done
Complete Story
Related Stories:
- Useful Wireless Networking Connection Commands - Ubuntu/Debian Linux(Aug 21, 2009)
- 5 Simple Bash Tips, Part III(Aug 13, 2009)
- Ten essential commands for Linux tasks(Aug 07, 2009)
- 10 Essential UNIX/Linux Command Cheat Sheets(Aug 05, 2009)
- 5 Excellent Downloadable eBooks To Teach Yourself Linux(Aug 05, 2009)
- How to have a lightweight, beautiful, functional terminal(Jul 30, 2009)
- Speaking UNIX: Man oh man(Jul 29, 2009)
- What's Bogging Down Your Linux PC? Tracking Down Resource Hogs(Jul 21, 2009)