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

Mount iso to /mnt on Solaris
Unmount $ umount /mnt Delete loopback file device $ lofiadm -d /dev/lofi/1

Exclude inserting a table from a sql import
Starting with a large MySQL dump file (*.sql) remove any lines that have inserts for the specified table. Sometimes one or two tables are very large and uneeded, eg. log tables. To exclude multiple tables you can get fancy with sed, or just run the command again on subsequently generated files.

rename anime fansubs
renames Anime Episodes to files, that can be parsed by sonarr & co

display a one-liner of current nagios exit statuses. great with netcat/irccat

resize all JPG images in folder and create new images (w/o overwriting)
Convert all jpegs in the current directory into ~1024*768 pixels and ~ 150 KBytes jpegs

Search manpages for a keyword
Search manpages for a keyword. Very useful when you don't know where to find the information.

Search for a single file and go to it
This command looks for a single file named emails.txt which is located somewhere in my home directory and cd to that directory. This command is especially helpful when the file is burried deep in the directory structure. I tested it against the bash shells in Xubuntu 8.10 and Mac OS X Leopard 10.5.6

Are the two lines anagrams?
This works by reading in two lines of input, turning each into a list of one-character matches that are sorted and compared.

diff files while disregarding indentation and trailing white space

tmux start new session with title and execute command
in this examp start htop command in tmux session over the shell cosole and set title for the tmux without doing it manuelly in tmux


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: