Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


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: