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

Simple XML tag extract with sed
Limited, but useful construct to extract text embedded in XML tags. This will only work if bar is all on one line. If nobody posts an alternative for the multiline sed version, I'll figure it out later...

Displays the current time using HTTP
This command will show the current GMT time using HTTP. This might be useful if you just want to know what's the current human-readable and accurate-enough time, without changing the system time, using a simple command that would work regardless of the availability of NTP. Note: To get a quicker and more accurate response, replace google.com with your local NTP server. Also can be used as an alternative to the "htpdate" program: http://www.commandlinefu.com/commands/view/668/set-your-computers-clock-using-http-and-htp-http-time-protocol-when-ntpsntp-is-not-available

SSH connection through host in the middle
Unreachable_host is unavailable from local network, but it's available from reachable_host's network. This command creates a connection to unreachable_host through "hidden" connection to reachable_host.

Unlock your KDE4 session remotely (for boxes locked by KDE lock utility)
Do the unlock KDE screen saver locked session with lightdm display manager used in Kubuntu 12.10 +

list files recursively by size

Output a list of svn repository entities to xml file
I use this to pull the last commit date for everything in my repo, so I can tell the client which files haven't been touched or updated since the repo was created. Another way to do it is to use svn log, but that does not pull the "kind" attribute. It does, however, give you the commit message. Both are very useful.

Edit your command in vim ex mode by <ctrl-f>
If you are in ex mode in vim i.e. you've pressed ':'. You can edit the current command by pressing <ctrl-f>

bulk dl files based on a pattern
-O switch creates local filename same as remote curl [][] -o #1#2 makes local files unique inserting sequence values into #x placeholders sequences can be alpha or numeric e.g [a-z] [1-25]

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

Stream audio over ssh ogg version
Stream OGG vorbis over ssh.


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: