Tag Archives: bash

Open all your reddit subscriptions using a single command (alias)

Introduction

The alias command is considered both good and bad. It can sometimes simplify long and complex commands, but on the other hand it can also be misused to hide commands everyone could learn otherwise.

Long time Linux users have been using alias for many commands and scripts. Even the operating system itself uses alias for certain commands e.g ll for ls -alF, la for ls -A and so on. However, this tutorial is not going to be about simplifying existing commands, rather it is going to be about aliasing your reddit subscriptions.

Continue reading

Leave a comment

Filed under Uncategorized

Rename large list of files by removing just one character

Sometimes, we have a large collection of files e.g mp3 files that plays fine in a computer, but fails to copy to an external devices like a mobile phone, because of weird file naming. One of such cases happened to me, where all the files in a directory had pipe character (|) on them.

Those files would play fine on a computer, but failed to copy to a phone. Therefor,e I had to create following script to rename all those files, just by removing the pipe character(|). Here is the script (rename.sh).

for file in *.mp3
do
 rename 's/\|//' "$file"
done

I hope it helps someone.

 

Leave a comment

Filed under Uncategorized