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 all files under a certain directory /home that have a certain suffix at the end of the file name. Show the file and rename them to remove the suffix.

Reclaim standard in from the tty for a script that is in a pipeline
This will grab the controlling tty regardless of what STDOUT and STDERR are doing.

extract all urls from firefox sessionstore
This will extract all of the urls from a firefox session (including urls in a tab's history). The sessionstore.js file is in ~/.mozilla/firefox/{firefox profile}

See entire packet payload using tcpdump.

Silently deletes lines containing a specific string in a bunch of files
This command will find all occurrences of one or more patterns in a collection of files and will delete every line matching the patterns in every file

View and review the system process tree.
The "pstree" command uses special line-drawing characters. However, when piped into the "less" pager, these are normally disabled.

Disassemble some shell code
This one liner takes the shell code that you can grab off of the web and disassemble it into readable assembly so you can validate the code does what it says, before using it. The shell code in the above example is from http://www.shell-storm.org/shellcode/files/shellcode-623.php You can replace "-s intel" with "-s att" to get AT&T format disassembly.

background a wget download

Unbelievable Shell Colors, Shading, Backgrounds, Effects for Non-X
I've been using linux for almost a decade and only recently discovered that most terminals like putty, xterm, xfree86, vt100, etc., support hundreds of shades of colors, backgrounds and text/terminal effects. This simply prints out a ton of them, the output is pretty amazing. If you use non-x terminals all the time like I do, it can really be helpful to know how to tweak colors and terminal capabilities. Like: $ echo $'\33[H\33[2J'

swap the java version being used
You have openjdk and sun java installed. Many of your java plugins will not work properly. Something called IcedTea (the java web plugin) keeps crashing. Run this and select sun java to use sun java.


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: