Difference between revisions of "Removing spaces from filenames"
From thelinuxwiki
(Pushed from Themanclub.) |
|||
Line 3: | Line 3: | ||
Shell one-liner | Shell one-liner | ||
− | <p>IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS Script | + | <p>IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS Script |
+ | |||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 05:42, 28 September 2013
Remove all spaces from all files in current directory:
Shell one-liner
IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS Script