Dired Trick #1

Many people say that once you get the hang of Dired, you never use anything else. How true is this?

From a personal perspective I’d say that was true, but the key is in the first part of the sentence once you’ve got used to using Dired…

Here’s real world use for Dired.

C-x d to start Dired and navigate to a directory.

Here’s a directory into which a CD has been ripped. The track names haven’t been recognised.

/home/*****/Music/Ludwig van Beethoven/Beethoven- Symphonies Nos. 1 & 2:
total used in directory 108088 available 32870008
drwxrwxrwx 2 ***** ***** 4096 Jun 8 2009 .
drwxrwxrwx 4 ***** ***** 4096 Jan 10 2009 ..
-rwxr--r-- 1 ***** ***** 19510080 Sep 21 2010 01 Track 1.mp3
-rwxr--r-- 1 ***** ***** 12268125 Sep 21 2010 02 Track 2.mp3
-rwxr--r-- 1 ***** ***** 7567075 Sep 21 2010 03 Track 3.mp3
-rwxr--r-- 1 ***** ***** 11410580 Sep 21 2010 04 Track 4.mp3
-rwxr--r-- 1 ***** ***** 20195615 Sep 21 2010 05 Track 5.mp3
-rwxr--r-- 1 ***** ***** 19836565 Sep 21 2010 06 Track 6.mp3
-rwxr--r-- 1 ***** ***** 7501945 Sep 21 2010 07 Track 7.mp3
-rwxr--r-- 1 ***** ***** 12329080 Sep 21 2010 08 Track 8.mp3

I could rename each track using a GUI by right clicking on each one and changing the name. Dired mode is faster

C-x C-q to toggle read only. Now simply type the new names of the tracks directly into the buffer. C-c C-c when you’ve finished.

If you want to be more efficient, move the point to the T in Track 1 and press M-z 1 to zap-to-char 1, deleting everything up to including the 1, leaving the .mp3 intact. Now type in the new track name.

If you want to be really efficient, of course, you could use search and replace…

Related Posts

Dired Tricks #2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.