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

install all archive file type apps in ubuntu

Make vim open in tabs by default (save to .profile)
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.

Attach screen over ssh
Directly attach a remote screen session (saves a useless parent bash process)

Hear the mice moving
Beeps on mouse's every move. Bear in mind that, at least on Ubuntu, /dev/input/mice can be read only by root.

connects to a serial console
cu (call UNIX) establishes a full-duplex connection to another machine (*BSD) using a serial console. It becames more useful than screen if you have to send a BREAK signal. using cu just type "~#". $man cu http://www.openbsd.org/cgi-bin/man.cgi?query=cu&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html

Get current logged in users shortname

A command to copy mysql tables from a remote host to current host via ssh.
In the example above 3 tables are copied. You can change the number of tables. You should be able to come up with variants of the command by modifying the mysqldump part easily, to copy some part of remote mysql DB.

processes per user counter
enumerates the number of processes for each user. ps BSD format is used here , for standard Unix format use : ps -eLf |awk '{$1} {++P[$1]} END {for(a in P) if (a !="UID") print a,P[a]}'

bulk rename files with sed, one-liner
Far from my favorite, but works in sh and with an old sed that doesn't support '-E'

Create a system overview dashboard on F12 key
Command binds a set of commands to the F12 key. Feel free to alter the dashboard according to your own needs. How to find the key codes? Type $ read Then press the desired key (example: F5) $ ^[[15~ Try $ bind '"\e[15~"':"\"ssh su@ip-address\C-m""" or $ bind '"\e[16~"':"\"apachectl -k restart\C-m"""


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: