Delete all files in a folder that don't match a certain file extension

2010-04-30 1 min read Bash Fedora Linux

$ rm !(.foo|.bar|*.baz)

Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.

  • <a href="http://www.commandlinefu.com/commands/view/5351/delete-all-files-in-a-folder-that-dont-match-a-certain-file-extension">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/hutch">View all commands by <a href="http://feeds2.feedburner.com/commands/by/hutch">hutch

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/TCRb2ku_V1Y" alt="" width="1" height="1" align="bottom" />

Continue reading

Lock the hardware eject button of the cdrom

2010-04-29 1 min read Fedora Learning Linux

$ eject -i 1 This command will lock the hardware eject button of your cdrom drive. Some uses are:

1: If you have a toddler and has discovered the cdrom button

2: If you are carrying a laptop in a bag or case and don&#8217;t want it to eject if the button is inadvertently pressed.

To unlock the button use:

eject -i 0

  • <a href="http://www.commandlinefu.com/commands/view/5390/lock-the-hardware-eject-button-of-the-cdrom">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/mdelatorre">View all commands by <a href="http://feeds2.feedburner.com/commands/by/mdelatorre">mdelatorre

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

Continue reading

Generate web thumbnails page (gallery) for free with convert command on linux

2010-04-12 1 min read Linux Photo

Here&#8217;s something for guys who want to generate html file with thumbnails of photos. I know sometimes it really gets messy. So sometime back I had found a search on the net for the same and found a script written by Samuel Hocevar.  Sorry I do not seem to have the link to the page, but since the script is GPL and name of the author is there in the script, I can put it for download from my web-blog also. So here is the script <a href="http://amit-agarwal.co.in/wordpress/wp-content/uploads/2009/01/genthumb.sh">genthumb

Continue reading

101 Linux hacks – free Linux Ebook

2010-03-09 1 min read Linux

Go and grab your copy of the free <a href="http://feedproxy.google.com/~r/TheGeekStuff/~3/KNUpyY4YE9c/" target="_blank">ebook.

Quite nice book with small little hacks but sometimes the details are too much, specially the one on the cd command. I think there was no need for 3-4 examples of the same thing, but then nice collection and nice ebook.

How To Build A Self-hosted WordPress Blog For Free

2010-02-04 1 min read Linux

A blog is a layman-friendly variation of a website, and having a blog is one of the many ways to state your presence in the virtual world. While there are many hassle-free blog services out there that will take care of everything except automatically blog for you – like <a href="http://www.makeuseof.com/tags/blogger">Blogger and <a href="http://www.makeuseof.com/tags/wordpress">WordPress, nothing can beat a self-hosted blog in the terms of customization and self pride.

The problem is, the process of building your own self-hosted blog is (almost always) not free and is considered complicated. So most newbies will choose the easier path and never give themselves a chance to experiment.

Continue reading

Web Thumbnails, create your account to upload your files.

2010-02-04 1 min read Linux

So, since I got one more address, I thought of some social service too ;). Just kidding. Got my gallery site up. You can use it too to upload your photos. For stopping social abuse I would personally be montoring the accounts thus created and you would need to send a mail to gallery@amit-agarwal.co.in for creation of the account. Right now there is no quota on the size of the space.

Continue reading
Older posts Newer posts