Skip to content

Instantly share code, notes, and snippets.

@ammist
Last active January 1, 2016 15:18
Show Gist options
  • Save ammist/46f6deec26e95ef2ef6b to your computer and use it in GitHub Desktop.
Save ammist/46f6deec26e95ef2ef6b to your computer and use it in GitHub Desktop.
find files newer than [filename] and copy them to [dirname]
find . -type f -newer '[filename]' -print0 | xargs -0 -I {} cp {} [dirname]
# replace strings in a file without creating a backup. the -i parameter would create a backup if you so desired
sed -i '' 's/techliminal/localhost/g' [filename]
# find all the javascript files and list them
find . -name *.js -print | xargs ls -l
# change the owner of all the javascript files
# Looks like the sudo has to be on the xargs / chown part of the operation
find . -name *.js -print | sudo xargs chown anca:www-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment