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

Find broken symlinks
Locate broken symlinks in the current directory. Also useful, to remove broken links: $ find . -type l ! -exec test -e {} \; -print0 | xargs -0 rm

open manpage and search for a string
This will open the manpage for "foobar", and display all instances of "searched_string". You can traverse through them by pressing "n"

grep for minus (-) sign
Use flag "--" to stop switch parsing

Create a file of repeated, non-zero
dd can be used with /dev/zero to easily create a file of all zero-bytes. Pipe that through tr and use octal conversions to change the byte values from zero to 0xff (octal 0377). You can replace 0377 with the byte of your choice. You can also use \\0 and \\377 instead of the quoted version.

unrar all part1 files in a directory

Watch the progress of 'dd'
dcfldd is a forensic version of dd that shows a process indicator by default.

Display the end of a logfile as new lines are added to the end

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

Bash function that saves bash functions to file from shell session
The simpler, 1-arg version is save_function(){ { date +"# %F.%T $1; declare -f "$1";}| tee -a ~/.bash_functions; }`

insert ip range using vim
fast method for insert ip range using vim


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: