Skip to content

Instantly share code, notes, and snippets.

@arnorhs
Created January 21, 2011 22: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 arnorhs/790581 to your computer and use it in GitHub Desktop.
Save arnorhs/790581 to your computer and use it in GitHub Desktop.
a few linux commands i have hanging around.. collecting
# find only files and chmod
# because I never remember the syntax
find . -type f -exec sudo chmod 664 {} \;
# untar .tar.gz
tar xvzf file.tar.gz
# untar .tar.bz2
tar xjvf file.tar.b
# to compress as .tar.gz
tar czf filename.tar.gz /path/to/folder
# find/replace í mörgum skrám.. fengið að láni (og útskýrt) frá:
# - http://rushi.wordpress.com/2008/08/05/find-replace-across-multiple-files-in-linux/
find . -name "*.php" -print | xargs sed -i 's/foo/bar/g'
# bara finna í mörgum skrám og birta línunúmer:
find . -name "*.php" -exec grep -Hin 'strengur' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment