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

Set gnome wallpaper to a random jpg from the specified directory
Every time this is run it will change your background picture. For added fun Add some DBUS magic: . $HOME/.dbus/session-bus/`cat /var/lib/dbus/machine-id`-0 export DBUS_SESSION_BUS_ADDRESS and a crontab entry: */5 * * * * above_command_in_script.sh >/dev/null 2>/dev/null now wallpaper changes every 5 mins

Apply fade effect to a audio
fade [type] fade-in-length [stop-time [fade-out-length]] Apply a fade effect to the beginning, end, or both of the audio. An optional type can be specified to select the shape of the fade curve: q for quarter of a sine wave, h for half a sine wave, t for linear (`triangular') slope, l for logarithmic, and p for inverted parabola. The default is logarithmic. A fade-in starts from the first sample and ramps the signal level from 0 to full volume over fade-in-length sec? onds. Specify 0 seconds if no fade-in is wanted. For fade-outs, the audio will be truncated at stop-time and the signal level will be ramped from full volume down to 0 starting at fade-out-length seconds before the stop-time. If fade-out-length is not specified, it defaults to the same value as fade-in-length. No fade-out is performed if stop-time is not specified. If the file length can be determined from the input file header and length-changing effects are not in effect, then 0 may be specified for stop-time to indicate the usual case of a fade-out that ends at the end of the input audio stream. All times can be specified in either periods of time or sample counts. To specify time periods use the format hh:mm:ss.frac format. To specify using sample counts, specify the number of samples and append the letter `s' to the sample count (for example `8000s').

Download Video & extract only a specific Time of it

Count items in JSON array
Pipe any JSON to jq, then count with the appropiate expression and use the | length on the array

check open ports without netstat or lsof

Find the package that installed a command

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Discovering all open files/dirs underneath a directory
It may be helpful in case you need to umount a directory and some process is preventing you to do so keeping the folder busy. The lsof may process the +D option slowly and may require a significant amount of memory because it will descend the full dir tree. On the other hand it will neither follow symlinks nor other file systems.

Count all the files in the directory and child directories

back ssh from firewalled hosts
host B (you) redirects a modem port (62220) to his local ssh. host A is a remote machine (the ones that issues the ssh cmd). once connected port 5497 is in listening mode on host B. host B just do a ssh 127.0.0.1 -p 5497 -l user and reaches the remote host'ssh. This can be used also for vnc and so on.


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: