Welcome To Snipplr
Everyone's Recent Bash Snippets Tagged files
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
699
posted 11 years ago by satie83
Hash of the commit which you want to show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d
0
1175
posted 11 years ago by satie83
In order to avoid make files executable, you can use these to chmod files and directories differently.
0
688
posted 12 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
1264
posted 12 years ago by licensetoil
Bash
Delete all files of a directory which contains a specific contents, no mather the size of the directory
0
773
posted 12 years ago by ferro
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
577
posted 13 years ago by Carolyne
Come modificare i permessi di tutti i files (senza toccare le cartelle) o viceversa
0
498
posted 13 years ago by tuffo19
-print0 and -0 are used to allow for spaces and other wacky chars in file names
0
567
posted 13 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
545
posted 13 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
602
posted 14 years ago by vigoncas
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
854
posted 15 years ago by mattkenefick
Example code would remove all files/folders recursively starting from the current folder named file_name
0
655
posted 15 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
766
posted 15 years ago by Juanje
test with echo instead of mv
example removes spaces after dots, replaces spaces with _, removes ' , and -, and finally lowercases filenames
1
788
posted 16 years ago by iblis