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

list files recursively by size

Getting ESP and EIP addresses from running processes
'ps' let you specify the format that you want to see on the output.

Quick glance at who's been using your system recently
This command takes the output of the 'last' command, removes empty lines, gets just the first field ($USERNAME), sort the $USERNAMES in reverse order and then gives a summary count of unique matches.

First file editor for newbies
This command should be the first file-editing command for a newbie. It clears file.txt (cat), and asks for input until EOF is entered on its own line (not written to file.txt).

Find the package that installed a command

sudo for entire line (including pipes and redirects)
USAGE: $ sudor your command This command uses a dirty hack with history, so be sure you not turned it off. WARNING! This command behavior differ from other commands. It more like text macro, so you shouldn't use it in subshells, non-interactive sessions, other functions/aliases and so on. You shouldn't pipe into sudor (any string that prefixes sudor will be removed), but if you really want, use this commands: $ proceed_sudo () { sudor_command="`HISTTIMEFORMAT=\"\" history 1 | sed -r -e 's/^.*?sudor//' -e 's/\"/\\\"/g'`" ; pre_sudor_command="`history 1 | cut -d ' ' -f 5- | sed -r -e 's/sudor.*$//' -e 's/\"/\\\"/g'`"; if [ -n "${pre_sudor_command/ */}" ] ; then eval "${pre_sudor_command%| *}" | sudo sh -c "$sudor_command"; else sudo sh -c "$sudor_command" ;fi ;}; alias sudor="proceed_sudo # "

checks size of directory & delete it if its to small
only simple example how to combine rclone & jq

Change gnome-shell wallpaper

Indent a one-liner.
I often write a one-liner which I want to use later in a script.

Lock your KDE4 remotely (via regular KDE lock)
Forgot to lock your computer? Want to lock it via SSH or mobile phone or use it for scheduled lock? TIP: Make a alias for this (e. g. as "lock"). I found some howtos for ugly X11 lock, but this will use regular KDE locking utility. Note that KDE 3 is using utility with another name (I guess with the same argument --forcelock) Tested on Kubuntu 8.10. Stay tuned for remote unlock.


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: