What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.

If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags





Commands tagged wallpaper from sorted by
Terminal - Commands tagged wallpaper - 10 results
./mpv_identify.sh * | egrep '^video_aspect=1\.[67]'
2015-09-29 05:47:07
User: Tatsh
Functions: egrep

Checks if the aspect ratio is approximately 1.6 (16:10) or ~1.77777778 (16:9).

Requires mpv_identify from mpv project https://github.com/mpv-player/mpv/blob/master/TOOLS/mpv_identify.sh (this replaces mplayer -identify, or midentify)

wallpaper -w 800 -x 16384 -a 1.7 -b 1.85 *
2015-09-28 23:18:39
User: lordtoran

List images between 800 and 16384 pixels wide that can be displayed sized and trimmed on a widescreen display.

Requires the "wallpaper" utility.

convert http://imgs.xkcd.com/comics/now.png -negate /tmp/now.png ; DISPLAY=:0.0 awsetbg -c /tmp/now.png
2014-02-26 15:37:15
User: hybris
Tags: wallpaper xkcd

Get http://xkcd.com/now image, inverts colors (I prefer dark backgrounds) and set it as wallpaper.

You can replace the "convert" part by "wget -q http://imgs.xkcd.com/comics/now.png -O /tmp/now.png" if you prefer light backgrounds.

The DISPLAY variable is here to work as a cron job.

gsettings get org.gnome.desktop.background picture-uri | xargs nautilus
for i in $(wget -O- -U "" "http://wallbase.cc/random/23/e..." --quiet|grep wallpaper/|grep -oe 'http://wallbase.cc[^"]*'); do wget $(wget -O- -U "" $i --quiet|grep -oe 'http://[^"]*\.jpg');done
wallpaperWarn() { BG="/desktop/gnome/background/picture_filename"; convert "`gconftool-2 -g $BG`" -pointsize 70 -draw "gravity center fill red text 0,-360 'Warn' fill white text 0,360 'Warn'" /tmp/w.jpg; gconftool-2 --set $BG -t string "/tmp/w.jpg"; }
2011-09-07 19:00:40
User: totti

Display some text on the wallpaper especially warning messages

gsettings set org.gnome.desktop.background picture-uri 'file://<path-to-image>'
gconftool-2 -t str -s /desktop/gnome/background/picture_filename "$(find ~/Wallpapers -type f | shuf -n1)"
2010-09-21 04:01:55
User: zed

Changes your desktop background image in gnome. Update the directory to wherever you keep your wallpapers. I like to create a sub-directory in my Wallpaper folder called "cycle" that I use to define the wallpapers I wish to loop in cron. ex:

gconftool-2 -t str -s /desktop/gnome/background/picture_filename "$(find ~/Wallpapers/cycle -type f | shuf -n1)"
for i in ~/Desktop/Personal/Wallpapers/*.jpg ; { size=$((`identify -format "%wx%h" $i | sed 's/x/*/'`)) ; if [[ $size -lt 800001 ]] then ; rm -f "$i" ; fi; }
2009-10-16 00:21:21
User: cbrinker
Functions: rm sed

For all of the jpgs in a directory, determine their size and if below a threshold remove them forcefully.

gconftool-2 -t string -s /desktop/gnome/background/picture_filename <path_to_image>
2009-04-29 11:19:29
User: cammarin

You can use this in a script which rotates wallpapers from a directory at each login.