There are several ways one can batch rename files in Linux. One of the possibilities is the linux command rename.

Usage

To rename files you have to supply a Perl expression. Using Perl expressions might be scary for beginners (because they look like someone hit his head on the keyboard), but they allow for complex renaming with a minimum of characters.

Although I won’t go into detail about Perl expressions here, I will try to make it a little easier for beginners to use them for batch renaming.

According to the man page of rename, this is the way to use rename:

rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]

If you have not worked with Perl expressions before, this might not be enough to get you started. So let me present you with the way one would probably use rename most of the time:

rename 's/OLD/NEW/' FILES

OLD is an expressions which describes a pattern in the name filenames. If rename can find this pattern in the name of a file, it will replace this part of the filename with what is defined as NEW. The files rename should rename are defined by FILES.

Let me provide you with two examples: Continue reading »

 

The Linux command mkdir (make directory/make directories) can be used to create new directories.

Basic Usage

Creating directories in the current working directory

The most basic usage of mkdir is the following:

mkdir <name>

This will create a new directory with the given name in the current directory. Therefore, if your username is “me” and in the terminal you are using you are currently in your home folder (/home/me) then running the command

mkdir backup

will create a the directory /home/me/backup.

Continue reading »

 

If you ever wanted to create screenshots of a virtual machine (for a tutorial, a presentation, a forum post or any other reason), you probably already noticed that the VirtualBox GUI does not offer a screenshot function.

Continue reading »

 

 (Download the script from this article flac2mp3.sh)

When converting FLAC files to MP3, the first problem you will notice is that lame does not support FLAC files. This might now seem like big problem, because you can easily decode FLAC files using the command line tool flac and then use the decoded file with lame.

The Problem

The real problem is that you will loose your metadata in this process, so the tags you added to your FLAC won’t be copied to the MP3 file. While you could “easily” add them by hand, it is pretty annoying to do that even if you only want to convert a handful of files.

Continue reading »

 

Introduction

One of the possibilities of taking screenshots in Linux is using

xwd

, a utility of the X Window System.

I just want to give a short overview on how to take interactive and non-interactive screenshots, view them and convert them to different formats. Continue reading »