All commands (14,187)

What's this?

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.

Share Your Commands


Check These Out

generate random password (works on Mac OS X)
Prepending env LC_CTYPE=C fixes a problem with bad bytes in /dev/urandom on Mac OS X

output length of longest line
If your wc does not have the -L option, you can use awk.

Monitor a file with tail with timestamps added

Stop Flash from tracking everything you do.
Brute force way to block all LSO cookies on a Linux system with the non-free Flash browser plugin. Works just fine for my needs. Enjoy.

Put split files back together, without a for loop
After splitting a file, put them all back together a lot faster then doing $cat file1 file2 file3 file4 file5 > mainfile or $for i in {0..5}; do cat file$i > mainfile; done When splitting, be sure to do split -d for getting numbers instead of letters

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

Decode base64-encoded file in one line of Perl
Another option is openssl.

Erase DVD RW

list files recursively by size

Prints a file leaving out all blank lines and comment-only lines
Does not print any line that either: - is empty - contains only spaces or tabs - starts with # - starts with spaces/tabs followed by a #


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: