Welcome To Snipplr


Everyone's Recent Bash Snippets Tagged files



« Prev 1 2
Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some more commits. Then, I find I need to restore that file.
0 126 posted 7 years ago by satie83
Hash of the commit which you want to show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d
0 179 posted 8 years ago by satie83
In order to avoid make files executable, you can use these to chmod files and directories differently.
0 130 posted 8 years ago by wnasich
Add this to your .profile or .bash_rc file, source the file, navigate to the directory and call "rm_whitespace" Based on: http://snipplr.com/view/4468/batch-rename-files-in-directory/
1 274 posted 8 years ago by licensetoil
0 90 posted 9 years ago by vigoncas
Found on the Ubuntu forum: http://ubuntuforums.org/showthread.php?t=1355021 Renames files to 0001.jpg, 0002,jpg etc You can insert a prefix here: "prefix-$j.jpg"
0 85 posted 9 years ago by Carolyne
Come modificare i permessi di tutti i files (senza toccare le cartelle) o viceversa
0 72 posted 9 years ago by tuffo19
-print0 and -0 are used to allow for spaces and other wacky chars in file names
0 79 posted 9 years ago by jfine
1st shows only files and directories bigger than 1 Megabyte 2nd shows only files and directories bigger than 100 Megabyte
0 73 posted 10 years ago by kossmoss
If you have these files: old-file.php file-old.php file-old-file.php license.txt and you apply the snippet then you'll have these files: new-file.php file-new.php file-new-file.php license.txt ;-)
0 65 posted 10 years ago by vigoncas
Count number of files in a directory
1 69 posted 10 years ago by marcelodornelas
used to sort out empty music-files
0 122 posted 10 years ago by 1b0t
find . | xargs grep 'string' -sl The -s is for summary and won't display warning messages such as grep: ./directory-name: Is a directory The -l is for list, so we get just the filename and not all instances of the match displayed in the results...
2 119 posted 11 years ago by mattkenefick
Example code would remove all files/folders recursively starting from the current folder named file_name
0 87 posted 12 years ago by jturmel
Some times you need some specific range of lines from a file and the commands 'head' and 'tail' are not enough for you. This could be a easy solution for this problem.
2 103 posted 12 years ago by Juanje
0 80 posted 12 years ago by assbach
« Prev 1 2