Created
January 21, 2011 22:43
-
-
Save arnorhs/790581 to your computer and use it in GitHub Desktop.
a few linux commands i have hanging around.. collecting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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