Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Mui Potu

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Rename *nix filenames


I am a bit slow sometimes and it took me a while to find this unix command that most are probably already aware of. rename is a very useful tool. The example I have here will susbtitute "foo" for "bar" of any file with foo in the name. The really nice thing about this is that it can use and regular expression syntax (ie. "^", "$", etc..).

rename -n 's/foo/bar/' *foo*
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS