Skip to content

Instantly share code, notes, and snippets.

@benwei
Created April 13, 2018 14:12
Show Gist options
  • Select an option

  • Save benwei/10fcadde4b094bad95ce9d8493f561a8 to your computer and use it in GitHub Desktop.

Select an option

Save benwei/10fcadde4b094bad95ce9d8493f561a8 to your computer and use it in GitHub Desktop.
trim space chars in txt filename in current directory
find *.txt | grep " " | while read fn ; do xfn=`echo $fn | tr -d ' '`; mv "$fn" "$xfn" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment