Skip to content

Instantly share code, notes, and snippets.

@htr3n
Last active January 19, 2018 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save htr3n/93ceccd290c904a1d78e6ee9959c83d7 to your computer and use it in GitHub Desktop.
Save htr3n/93ceccd290c904a1d78e6ee9959c83d7 to your computer and use it in GitHub Desktop.

Find & Copy

find /path/to/find -name '*.txt' -exec cp {} /new/path \;

  Find & Handling Spaces in File Names

find . -print0 | xargs -0 <command>
find . -print0 | while read -d $'\0' file; do cp -v "$file" /tmp; done

Find and Change Modes

find public_html/ -type d -exec chmod 755 {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment