Saturday, November 22, 2014

Wednesday, November 19, 2014

Change filesystem label in Ubuntu 14.04

You probably noticed that drives in Ubuntu, by default, have their names by its size, not by operating system on it or by description of content. That's annoying me.

To change that, You need two packages: e2fsprogs and ntfs-3g.

First package contains e2label tool, for changing ext2, ext3 or ext4 filesystem label. And second contains ntfslabel tool for changing ntfs (Windows) filesystem label.

I think both e2fsprogs and ntfs-3g are installed by default in Ubuntu 14.04.

To change Your Linux or Windows filesystem label, do:

sudo ntfslabel WIN-DEVICE NEW-LABEL

Replace LINUX-DEVICE and WIN-DEVICE with appropriate ones (i.e. /dev/sda2 or /dev/sda5). Replace NEW-LABELs with desired names, too.

See picture above for diffs.

For more options, see man pages of the tools.

Monday, November 17, 2014

Create aliases in Ubuntu 14.04

How often You must run some long commands in terminal? Even if You do not use "complicated" commands, You probably typed, at least once, the commands for updating Your system.

You know, like this:

sudo apt-get update && sudo apt-get upgrade

This and similar (long) commands can be very iritated, no matter if You use it often. Because of that, You can create aliases for frequently used commands. Alias is shorter command. In example, You can type update to update Your system instead of the above (long) command.

To do this, You need to enter alias for a command in appropriate file. That file is $HOME/.bashrc. It's hidden file, located in Your /home directory. To see it, press ctrl+h key combo. Open the file and scroll down to the bottom. Now, enter aliases for desired commands, like this:

alias update="sudo apt-get update && sudo apt-get upgrade"

See how it looks in my .bashrc file:

I created section My aliases and put there aliases for frequently used commands. You can call it whatever You want.

After You finish this, Save the file. Now, You need to do one more step. Open terminal and type:

source ~/.bashrc

After that, when You want to update Your system, all You need to type in terminal is update.

Saturday, November 15, 2014