This function will find the modification time in unix_time of the given file, then calculate the number of minutes from now to then and then find all files modified in that range. Show Sample Output
Caution: distructive overwrite of filenames Useful for concatenating pdfs in date order using pdftk
rename all dirs with "?" char in name, leave spaces and () in place Show Sample Output
Way more easy to understand for naive user. Just returns the biggest file with size.
Command to compress logs
"$PWD" (in quotes) accounts for spaces and other characters normally escaped in file or folder names
Warnings and errors will be suppressed Show Sample Output
Uses "locate" instead of "find", "sort -u" instead of "sort | uniq" and it's case insensitive. Show Sample Output
This command tars/gz all the folders contained in a directory. Only applies to top level directory. Very handy when you have to transfer mny folders containing lots of stuff. Can also work with tar only, zip...
Single file archives nested in subdirectories. After extracting them, you'll have the file (e.g. file.ext) and the archive (e.g. file.ext.nco) side by side. Sometimes you'll only have the archive (if you didn't extract them, or if there was an error during extraction). Only delete the archive if the single file is present in the same directory. Show Sample Output
This version works on OS X (if you have installed `rename`)
find '.odt' files that contain USAGE: grepodt
Only search source files directly related to current project. Everything under the "node_modules" directly are ignored.
Returns a list, with attributes (think `ls -l`), in reverse chronological order. N is a single numeric parameter. Robust against unfriendly filenames and directory structures. Show Sample Output
debian kernel 4.4.6 Show Sample Output
It's always a good idea to check the output of find without -delete before hand to make sure the results are as you expect. If you want to see where the broken symlinks point, use
find . -xtype l -exec ls -l {} \+
To allow recursivity :
find -type f -exec md5sum '{}' ';' | sort | uniq -c -w 33 | sort -gr | head -n 5 | cut -c1-7,41-
Display only filenames :
find -maxdepth 1 -type f -exec md5sum '{}' ';' | sort | uniq -c -w 33 | sort -gr | head -n 5 | cut -c43-
Show Sample Output
-name : base of filename -o : 'or' '*.c' : avoiding "paths must precede expression" error message -type f : only find file type --color: hightlight specific word with color -E : extended regexp 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: