Subscribe to Alvin Poh's Blog by RSS reader
Subscribe to Alvin Poh's Blog by Email
Gadgets, Technology, Public speaking and IT from an undergraduate's perspective.
Recursively Delete Selected Files or Folders In Windows
I was looking around for a way to recursively delete files and folders of a specific name in Windows. For example, imagine having “/folderA/folderB/file1.doc” and “/folderA/folderC/file1.doc”, and I wanted to remove all instances of file1.doc. Now imagine this file1.doc being presented in hundreds of folders. Deleting each file manually would drive anyone crazy.
I know Unix has a more powerful commandline interface, so operations like this should be a snap, but I was certain Windows had a similar functionality too. So I went about searching for a simple solution to do so. I was so intent on finding a simple batch file or DOS command that would do the recursive delete that I didn’t think of anything else until it suddenly slammed into me like a bullet train.
I could just use the search function in Windows! Yes that’s right — the normal Windows search is already a powerful enough function that accepts wildcards and does recursive searching. So I went to Windows search, specified my folder, and put in my filename. Sure enough, all the hundred or more instances of that file popped up almost instantly. From there it was just a matter of selecting all of them and deleting them. Everything took less than 10 seconds!
Subscribe to my blog:
RSS reader
Email
How do I create and remove a symbolic link?
I was fiddling around with symbolic links in my unix box and realised how cool they were. Basically symbolic links (or symlinks) create a virtual copy of the master file. This virtual copy has almost 100% of the master’s functionalities and characteristics (you’ll need to play around with the owner and file permissions sometimes though), and the really good thing about symlinks is that if you update the master files, your symlinks automatically get updated too!
Here’s the Code for Creating a Symbolic Link (Symlink)
ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]
For example:
ln -s /home/user/public_html ./user
This points a symbolic link “./user” to /home/user/public_html”. If you want to create symlinks to the directory’s contents instead, add an asterisk to the end, like so “directory/*”. That will tell Unix to create the symbolic links to point to everything contained in the folder.
Here’s the Code for Removing or Deleting a Symbolic Link (Symlink)
rm directory
You can also use unlink, like this:
unlink directory
One thing I’ve realised is that you shouldn’t leave a trailing slash, because that denotes that the target is a directory, and Unix will complain.
Subscribe to my blog:
RSS reader
Email
Bookmark Bridge Review and Screenshot

I use both Firefox and Internet Explorer, and one of the pet peeves that I have is that both of them don’t share bookmarks / favourites. This is a problem because when I save a site in Firefox, I want to be able to access it in Internet Explorer and vice versa.
Well, here’s the solution, it’s called Bookmark Bridge, and what it does is that it syncs the bookmarks between Firefox and IE. Very straightforward application, and does what it’s supposed to do perfectly!
Visit the Bookmark Bridge website, it’s open-source software that runs on Linux and Windows!
Subscribe to my blog:
RSS reader
Email
Clearing your web browser’s cache (IE, Firefox, Safari)
Some browsers automatically cache a webpage that you visit by default, and serve that cached webpage the next time you visit. That’s a problem especially if the page is constantly updated, because your cached version will be showing you outdated information. So sometimes, you’ll find yourself needing to clear your browser’s cache. Here’s how to do it for the various browsers out there:
Firefox 1.5
- PC: Go to the Tools menu and select Options
Mac: Go to the Firefox menu and select Preferences - Click on the Privacy icon
- Click on the Cache tab
- Click on Clear Cache Now
- PC: Click OK
Mac: Click on the red dot in the upper left corner of the window
Firefox 2.0
- PC: Go to the Tools menu and select Options
Mac: Go to the Firefox menu and select Preferences - Click on Advanced icon
- Click on the Network tab
- Click on Clear Now
- PC: Click OK
Mac: Click on the red dot in the upper left corner of the window
Internet Explorer 6
(Note: CTRL-F5, is a shortcut for ‘refresh’ and ‘clear cache’)
- Go to the Tools menu and click on Internet Options.
- Ciick on Delete Files…
- Check the box for "Delete all offline content", then click OK
- Click OK OR
Internet Explorer 7
(Note: CTRL-F5, is a shortcut for ‘refresh’ and ‘clear cache’)
- Go to the Tools menu and click on Internet Options
- Click on Delete
- Click on Delete files
- Click Close, then OK
Safari
Go to the Safari menu and select Empty Cache…
Netscape 7.1
- PC: Go to the Edit menu and select Preferences
Mac: Go to the Netscape menu and select Preferences - On the left side, click on the triangle next to Advanced
- Click on Cache
- On the right side, click on Clear Cache
- Click Close
Subscribe to my blog:
RSS reader
Email
Synchronise 2 Laptop and Desktop with Unison Free Synchronization Software
I have a laptop and a desktop, and one of the problems that I faced was to get my files synchronized. I work on my desktop while I’m at home, and on the go, I rely on my laptop. However, I need my files to be the same on both laptop and desktop.
In the past I used to do a manual sync with rsync, but now I’ve just discovered Unison and it solves the pain of synchronization, because unlike rsync, Unison works both ways. With Unison, I can set it so that any files that I change on my laptop will get synchronized with my desktop, and vice versa.
I don’t use this feature, but Unison has versions for the Linux and Mac platforms as well, and allows you to synchronize with different OS-es. So if you’re using a Mac desktop and have a windows laptop, and work with Linux at your workplace — no problems!
The great thing about Unison that it can work over SSH too, so you don’t have to be physically near your other computer — you can be lounging at Starbucks with your laptop, and synchronise your files over the public Wi-Fi connection.
And just in case you might have different synchronization needs from time to time, don’t worry, because Unison also has support for profiles. These syn allow you to create configuration files that can set preferences on different directories and files. Comprehensive documentation on profiles is available on the Web site.
All in all, Unison can be extremely useful and quite powerful. It doesn’t take the blind-sync approach by default, but allows you to determine what files to sync, if any, and in what direction. Using profiles, you can largely automate things to suit your situation.
Click here for the official Unison website.
Subscribe to my blog:
RSS reader
Email
12 Feb 08 | 

