Converts a number of bytes provided as input, to a human readable number. Show Sample Output
If your locale has Monday as the first day of the week, like mine in the UK, change the two $7 into $6 Show Sample Output
Sometimes top/htop don't give the fine-grained detail on memory usage you might need. Sum up the exact memory types you want
Check whether hyperthreading is enabled or not. a better solution as nproc should work on all OS with awk Show Sample Output
Fast and simple awk urldecoder! Note: Parameter -n is specific to GNU awk Show Sample Output
Displays the duplicated lines in a file and their occuring frequency.
Lists the local files that are not present in the remote repository (lines beginning with ?) and add them. Show Sample Output
Ever compress a file for the web by replacing all newline characters with nothing so it makes one nice big blob? It is a great idea, however what about when you want to edit that file? ...Serious pain in the butt. I ran into this today in that my only copy of a CSS file was "compressed" with no newlines. I whipped this up and it converted back into nice human readable CSS :-) It could be nicer, but it does the job.
Basically it creates a typical word list file from any normal text.
?Cat and grep? You can use only grep ("grep \. filename"). Better option is awk.
More of the same but with more elaborate perl-fu :-)
as unixmonkey7109 pointed out, first awk parse replaces three steps.
previous version leaves lots of blank lines
not the best, uses 4 pipes!
Counts TCP states from Netstat and displays in an ordered list. Show Sample Output
Emits the device names which will be printed by iostat for an LVM volume; doesn't show the names for the underlying devices when snapshots are being used (the -cow and -real devices in /dev/mapper) Show Sample Output
No need for grep, let awk do the match. This will not behave properly if the filenames contains whitespace, which is awk's default field separator.
Validate a file using xmllint. If there are parser errors, edit the file in vim at the line of the first error.
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: