Really, you deserve whatever happens if you have a whitespace character in a file name, but this has a small safety net. The truly paranoid will use '-i'.
This command will remove only files, not directories: if you wish to remove both directories and files, just remove '-type f' from command above
Removing .svn directories without a pipe
Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com. Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D Enjoy! Show Sample Output
This command, when run from the directory containing "filename", will remove the file and any hard or symbolic links to the file.
Deletes capistrano-style release directories (except that there are dashes between the YYYY-MM-DD) Show Sample Output
I wanted to play a song from the shell and get the shell back, I also dont want to store the file if it is not needed. edit, not sure if I need to mention it... killall vlc to stop it Show Sample Output
Replace YOURPASSWORDHERE with the pdf password. [qpdf needed]
If you have a directory with lot of backups (full backups I mean), when it gets to some size, you could want to empty some space. With this command you'll remove half of the files. The command assumes that your backup files starts with YYYYMMDD or that they go some alphabetical order. Show Sample Output
The glob pattern * expands to all files, no need for the 'ls' command. The quotes around "$i" make sure filenames with spaces in them are handled correctly. mplayer determines if it is a media file and plays it, or gives errors and the loop asks if this file has to be removed. Show Sample Output
sudo when you mean it ps aux | grep $USER exit Show Sample Output
do it, disown it and exit without time for a mess sudo when you mean it ps aux | grep $USER exit Show Sample Output
Finds all nfo files without the filename movie.nfo and deletes them.
Sometimes you just want to operate on files that were created after specific date. This command consists of 3 commands: - Create a dummy file with the custom date - Find all files with "creation time" further than our custom date by using `-newer` find option. Add your crazy stuff here, like moving, deleting, printing, etc. - Remove the dummy file Show Sample Output
For a python project, sometimes I need to clean all the compiled python files. I have an alias 'rmpyc' to this command. This really saves me a lot of typing and hunting throughout the folders to delete those files.
Found here: http://xentek.net/xentek/315/recursively-delete-svn-folders/ This is fast and efficient because rm is only run once.
You can use this command to delete CVS/svn folders on given project.
Adds the stdout (standard output) to the beginning of logfile.txt. Change "command" to whatever command you like, such as 'ls' or 'date', etc. It does this by adding the output to a temporary file, then adding the previous contents of logfile.txt to the temp file, then copying the new contents back to the logfile.txt and removing the temp file.
remove files with access time older than a given date. If you want to remove files with a given modification time replace %A@ with %T@. Use %C@ for the modification time. The time is expressed in epoc but is easy to use any other format. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: