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.
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.
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
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:
My take on the original: even though I like the other's use of -exec echo, sed just feels more natural. This should also be slightly easier to improve.
I expanded this into a script as an exercise, which took about 35 minutes (had to look up some docs): http://bitbucket.org/kniht/nonsense/src/7c1b46488dfc/commandlinefu/quick_image_gallery.py
There are 2 alternatives - vote for the best!
Setting: You have a lot of jpg files in a directory.
Maybe your public_html folder which is readable on the net because of Apache's mod_userdir. All those files from the current folder will be dropped into a file called gallery.html as image tags that can be viewed within a web browser locally or or over the Internet.
Original:
find . -iname "*.jpg" -exec echo "<img src=\"{}\">" >> gallery.html \;
This includes a title attribute so you can see the file name by hovering over an image. Also will hoover up any image format - jpg, gif and png.
If you can do better, submit your command here.
You must be signed in to comment.
kniht, shouldn't that end with >> gallery.html so that each invocation appends to the initial result instead of overwriting it?
@unixmonkey10648: The redirection applies to all of the output of sed, which is the output of everything piped to it from find (after substitution) -- there is only one invocation. If you wanted to combine multiple directories into one gallery.html, you could do that by changing "find ." to "find some/a other/b third-directory". If you really did want to append to gallery.html, you could do that, of course, it would just be unusual.
Also, I kept the original's *.jpg mask, but you could change -iname to -iregex to grab multiple image types.
http://bitbucket.org/kniht/nonsense/src/7c1b46488dfc/commandlinefu/quick_image_gallery.py
http://www.nfljerseys.us/ NFL Jerseys
http://www.yeezyboost350.us.com/ Yeezy Boost 350 V2
http://www.longchampbags.us.com/ Longchamp Handbags
http://www.adidas-uk.org.uk/ Adidas UK
http://www.yeezys.org/ Yeezys
http://www.nike-stores.fr/ Nike Store
http://www.underarmouroutlet.us.com/ Under Armour Outlet
http://www.timberlanduk.org.uk/ Timberland Boots
http://www.jordan12.us/ Jordan 12
http://www.yeezy-shoes.us.com/ Yeezy Shoes
http://www.nikehuarache.us/ nike huarache
http://www.kedsshoesforwomen.com/ Keds Shoes For Women
http://www.yeezy.com.co/ Yeezy Shoes
http://www.nikeairmax.us/ Nike Air Max 2017
http://www.outlettoms.us/ Toms Outlet
http://www.ultraboostuncaged.us/ Ultra Boost
http://www.mlb-jerseys.us/ MLB Jerseys
http://www.adidas-nmds.com/ Adidas NMD
http://www.oakleyoutlet.net.co/ Oakley Outlet
http://www.rboutlet.org/ Ray Ban Outlet
http://www.katespadeoutlets.us/ Kate Spade Outlet
http://www.adidas-outlet.org/ Adidas Outlet
http://www.nikeairmax-90.com/ Nike Air Max 90
http://www.timberland-outlet.us/ Timberland Outlet
http://www.rayban-sunglasses.ca/ Ray-Ban Sunglasses
http://www.adidas-nmd.org.uk/ Adidas UK
http://www.adidaseqt.com/ Adidas EQT
http://www.ralphlaurens.org.uk/ Ralph Lauren UK
http://www.jordan4.us/ Jordan 4
http://www.cheapjordan-shoes.com/ Cheap Jordan
http://www.adidasnmdoutlet.com/ NMD Outlet