Commands by henix (1)

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

HDD Performance Write Test
Test your XFS filesystem and Raptor hard drives for write performance.

mercurial close branch

Make ls output better visible on dark terminals in bash
Sometimes you have a situation where you cannot properly see the ls output when you are using a terminal w/a dark background. Usually bash has ls aliased to use colors, and you can easily get ls to use the default foreground color via simply unaliasing the command.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Copy text to the clipboard
Great for little scripts that dig up obscure info that you are going to have to paste into another app anyway.

add all files not under version control to repository
checks which files are not under version control, fetches the names and runs them through "svn add". WARNING: doesn't work with white spaces.

Find the location of the currently loaded php.ini file
Quick and easy way to find out which php.ini file is being used. Especially useful if you just need to find the location of the file for editing purposes.

get detailed info about a lan card on HP-UX 11.31

Show interface/ip using awk
Interfaces like lo can be omitted from the beginning, there are probably better ways of doing this, i'm a noob at awk.

Sniffing network to generate a pcap file in CLI mode on a remote host and open it via local Wireshark ( GUI ).
Then hit ^C to stop, get the file by scp, and you can now use wireshark like this : $ wireshark /tmp/sniff.pcap If you have tshark on remote host, you could use that : $ wireshark -k -i


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: