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 all opened ports on host

Find the date of the first commit in a git repository
Finds the date of the first commit in a git repository branch

Keep from having to adjust your volume constantly
Run this in the directory you store your music in. mp3gain and vorbisgain applies the ReplayGain normalization routine to mp3 and ogg files (respectively) in a reversible way. ReplayGain uses psychoacoustic analysis to make all files sound about the same loudness, so you don't get knocked out of your chair by loud songs after cranking up the volume on quieter ones.

Losslessly rotate videos from your phone by 90 degrees.
Takes all the .3gp files in the directory, rotates them by 90 degrees, and saves them in the lossless ffv1 encoding. If this rotates in the wrong direction, you may want transponse=1 Re-encoding to ffv1 may result in a significant increase in file size, as it is a lossless format. Other applications may not recognize ffv1 if they don't use ffmpeg code. "huffyuv" might be another option for lossless saving of your transformations. The audio may be re-encoded as well, if the encoding used by your 3gp file doesn't work in a avi container.

Display unique values of a column
Find the unique values of a column utilizing awk. Credits goes to here (posted by "era"): http://www.unix.com/shell-programming-scripting/77138-awk-print-distinct-col-values.html

MySQL: Slice out a specific table from the output of mysqldump
Only filters the statement related to a specific table ('departments', in the example), from the output of mysqldump

Use tagged vlans
Great for sysadmins! Don't forget to pass the vlan to your port in a manageable switch. After vconfig, you should use $sudo ifconfig eth0.[VID] up Now the interface is up, you can use dhclient or ifconfig again to get an ip address.

Backup all MySQL Databases to individual files
Backs up all databases, excluding test, mysql, performance_schema, information_schema. Requires parallel to work, install parallel on Ubuntu by running: sudo aptitude install parallel

Filter the output of a file continously using tail and grep
The OPs solution will work, however on some systems (bsd), grep will not filter the data, unless the --line-buffered option is enabled.

One liner to kill a process when knowing only the port where the process is running
-k (kill option ) . To kill all processes accessing this port


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: