Posted By

powerthru on 10/11/10


Tagged

Shell directory filename rename


Versions (?)

strip leading text from all filenames in a directory


 / Published in: Bash
 

Execute on the command line. Assumes all files are in the current directory; does not recurse into subdirectories. Replace "*.html" with correct search term for your situation; replace "FS-" with the leading text you wish to remove. This example removes the text FS- from all files which end in .html

  1. for i in *.html; do mv "$i" ${i##FS-}; done;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: powerthru on October 11, 2010

learned from http://www.debian-administration.org/articles/150

You need to login to post a comment.