Tips & How-To's
Remove all files but one with rm
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
Is there any way to remove all of the files in a directory except for one with a certain filename? For instance, if I had a directory containing the files file1, file2, and dontdelete. Would there be any way to quickly delete file1, and file2 and not dontdelete? I know that I could just do rm file1 file2 but that wouldn’t work for a bunch of files. Also, I’m on Mac OS X if that makes a difference

Am I the only person who gets ln -s the wrong way round every time?
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
ln -s d1 d2 # Am I the only person who gets this the wrong way round every fucking time? Similar to most people who have posted there - I used to still get it wrong every time. It’s become a habit for me to do a man ln or ln -help before I execute this command :\ Great tip here though: but then I finally found out about the relationship between ln and cp

find command examples
· โ˜• 3 min read · โœ๏ธ Sathyajith Bhat
I’ve used find extensively and always wanted to writeup a nice post on this, but the linked post trumps my effort! Copy pasted from his blog, as the person’s allowed to do so. Also, as a general note - before using exec with the actual command, do preview it! ------------------------------------------------------------------------------------------ remove empty directories ------------------------------------------------------------------------------------------ # find . -depth -type d -empty -exec rmdir {} \; ------------------------------------------------------------------------------------------ change various file attributes ------------------------------------------------------------------------------------------ # find .

Removing file named -rf in Unix
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
I did something crazy at some point that created a file called “-rf” on my filesystem. Now I can’t figure out how to delete it. I’ve tried: rm "-rf" rm -rf But these just exit immediately. Arrgh! Anyone know how to remove this file? Preferably without accidentally cleaning out my whole folder. heh. What’re the odds, eh? via Removing “-rf” file in Unix - Super User.

File meta data and location of notes saved in notes tab of Nautilus
· โ˜• 2 min read · โœ๏ธ Sathyajith Bhat
I spend quite a lot of time on Super User(ย my repis a testament to that I guess ;) ) - both on the site as well as the mindblowingly awesomeย chat (if you haven’t been here, you *must* drop by). Today a user dropped by and asked a very nice question -ย which went like - I have some files that have some text in the notes fields(the tab where you put notes in the properties dialog box)โ€ฆ so can I output those texts with using the ls command.

[How to] Search through Bash history
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
Quick tip - if you use the Terminal as much as I do, ever been in a situation where you’ve written a particularly long command, and then want to issue that command again but can’t recall it ? Use the history command, and pipe it to grep to search it! history | grep -i <search-term> This will give you all commands with the search term and the corresponding line number.

HOWTO: Starcraft 2 on Linux with Wine
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
Starcraft 2 [runs] under my Linux install with no issues. Since the game’s official release a few days ago I have been getting a good bit of traffic on those two pages - so I figured I would put together a quick HOWTO for getting Starcraft 2 working on your Linux distro of choice. The game runs underย Wine 1.2 and/orย CrossoverGames 9.1. Crossover 9.1 Starcraft 2 is listed as “officially support” and as such you will find that it has an entry in the automated games installer.

Always display the location bar in Nautilus
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
This is a pretty good tip. The default style irritates me to no end. Check out the full post, there are some great tips, especially if you’re new to Nautilus like me. Ever since some distros started their attempt to become more โ€œuser-friendlyโ€ and gaining the nice looks, some default features got changed. In this case, itโ€™s the location bar. Instead of it they got some buttons that shows the location and let you navigate through the directories!

How To: Access Linux partitions ( including ext4) From Windows
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
Ext2Read is a Free & Open Source Software which allows you to browse your Linux partitions in a very Windows Explorer-esque interface. Unlike other tools Ext2Read also supports ext4 filesystem, even if extents feature is enabled. Like the name suggests โ€“ Ext2Read can only read, not write to the partitions โ€“ so in case you are paranoid about the tool causing data corruption to your Linux partitions, you can drop those fears.

Watermark Photos with digiKam
· โ˜• 1 min read · โœ๏ธ Sathyajith Bhat
digiKam supports watermarking, this feature is hidden so well that you might not even realize that itโ€™s there. This is because the watermarking function in digiKam is tucked under the Batch Queue Manager tool which you can use to watermark multiple photos in one go. Here is how this works in practice. Choose Tools | Batch Queue Manager (or press the B key) to open the Batch Queue Manager tool.