Results 1 to 2 of 2
I am a complete novice.
The following cut command works perfectly to trim a filename and output to the text file the new, correct filename.
What I cannot figure out ...
- 02-12-2012 #1Just Joined!
- Join Date
- Feb 2012
- Posts
- 1
bash file rename half solved
I am a complete novice.
The following cut command works perfectly to trim a filename and output to the text file the new, correct filename.
What I cannot figure out is how to MV the filename from the OLD name to the NEW name which is the output of the CUT command?
Suggestions?
ls -1 *pdf* | cut -f4 -d_ >list.txt
Thanks,
Rob
- 02-12-2012 #2Just Joined!
- Join Date
- Jan 2011
- Location
- Fairfax, Virginia, USA
- Posts
- 94
Hi Rcr,
Is something like this what your interested in?
Code:for original in *.pdf do newName=$( echo $original | cut -f4 -d_ ) mv $original $newName done


Reply With Quote