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 667 posted 10 years ago by satie83
Hash of the commit which you want to show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d
0 1123 posted 11 years ago by satie83
In order to avoid make files executable, you can use these to chmod files and directories differently.
0 659 posted 11 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 1219 posted 12 years ago by licensetoil
0 567 posted 12 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 549 posted 13 years ago by Carolyne
Come modificare i permessi di tutti i files (senza toccare le cartelle) o viceversa
0 471 posted 13 years ago by tuffo19
-print0 and -0 are used to allow for spaces and other wacky chars in file names
0 537 posted 13 years ago by jfine
0 526 posted 13 years ago by raphaelcangucu
1st shows only files and directories bigger than 1 Megabyte 2nd shows only files and directories bigger than 100 Megabyte
0 518 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 575 posted 14 years ago by vigoncas
Count number of files in a directory
1 519 posted 14 years ago by marcelodornelas
used to sort out empty music-files
0 725 posted 14 years ago by 1b0t
0 581 posted 14 years ago by smoover
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 815 posted 14 years ago by mattkenefick
Example code would remove all files/folders recursively starting from the current folder named file_name
0 621 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 724 posted 15 years ago by Juanje
1 618 posted 15 years ago by lakedenman
0 609 posted 16 years ago by assbach
test with echo instead of mv example removes spaces after dots, replaces spaces with _, removes ' , and -, and finally lowercases filenames
1 744 posted 16 years ago by iblis
Manipulate the names of all the files in a folder in bash
4 668 posted 16 years ago by benpjohnson
« Prev 1 2