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

online MAC address lookup

Create a backdoor on a machine to allow remote connection to bash
This will launch a listener on the machine that will wait for a connection on port 1234. When you connect from a remote machine with something like : nc 192.168.0.1 1234 You will have console access to the machine through bash.

Watch the National Debt clock
The idea was originally stolen from Linux Journal. 'wget' pulls the debt clock and 'sed' reformats it for general consumption. Prefacing the command with 'watch' simply sets an interval - in this case every 10 seconds.

Short one line while loop that outputs parameterized content from one file to another

Install pip with Proxy
Installs pip packages defining a proxy

Get info about a GitHub user
In this example 'git' is the user name and the output format is YAML but you can change this to XML or JSON, eg: curl http://github.com/api/v1/json/usernamehere

Display network pc "name" and "workgroup"
Checks for PC samba name and workgroup. Works fine for Windows hosts and Linux/UNIX PCs running Samba.

Create a PNG screenshot of Rigol Ultravision scopes attached per LAN
Scope should have the Rigol Ultravision Technology otherwise it won't accept the command. ImageMagic is required. Scope sends a 1.1M BMP file and converted to PNG it's only 18-20K

Check your unread Gmail from the command line
notice what happens when there is more than one unread message in a thread... also people please dont hardcode the password when you use curl. Leave it out and curl will ask you when it runs. Please...?

Bash prompt with user name, host, history number, current dir and just a touch of color
I put that line in my .bash_profile (OS X) and .bashrc (Linux). Here is a summary of what the \char means: n=new line, u=user name, h=host, !=history number, w=current work directory The \[\e[32m\] sequence set the text to bright green and \[\e[0m\] returns to normal color. For more information on what you can set in your bash prompt, google 'bash prompt'


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: