Linux / Debian / Ubuntu / ElementaryOS : Check real-time network up/down speeds in terminal

bmon is a command line utility for linux based systems to monitor the real-time upload - download network speeds on all network interfaces.

To install it on Debian based systems (read Ubuntu, Linux Mint, ElementaryOS etc.), use the command:

sudo apt-get install bmon

Here is a screenshot showing bmon in action.

bmon screenshot


Linux / Ubuntu : Multitask in terminal using Byobu

There are many instances when you wish that the current command being exexuted in the terminal goes to the background or that you get a second terminal to execute another command. This use case is pretty common when accessing server without a Graphical User Interface (GUI).

An extremely useful and powerful tool called Byobyu is the answer to this problem. In layman terms you can say that it is a “multi-window” terminal. While that definition is wrong on so many counts, it somehow would help the layman understand byobu.

To install byobu on debian based distributions (Ubuntu / Linux Mint etc.) use the following command:

sudo apt-get install byobu

Following are some of the useful commands for byobu

New Window - F2
Previous Window - F3
Next Window - F4
Reload Byobu - F5
Detach - F6
Scrollback Mode - F7
Re-title Window - F8
Configure Byobu - F9
Lock Termnal - F12


Linux : How to find the actual read and write speeds of hard disk

hdparm is a command line tool to find the actual read/write speeds of hard disk. To find the read write speeds of a drive, simply exexute the following command in terminal:

sudo hdparm -tT /dev/sda

the -t flag is for read timings and -T is for write timings.

/dev/sda is the disk on which the read/write timing measurements are to be performed.

In case hdparm is not installed, you can install it via command (in debian based distros):

sudo apt-get install hdparm

Linux : How to analyse disk usage using command line

To analyse disk usage using terminal, a very handy utility exists by the name of NCurses Disk Usage. To install it, type the following in Debian based distributions (Ubuntu, Linux Mint etc)

sudo apt-get install ncdu

The most common usage of ncdu is with the options -x and -q.

-q Quiet mode, doesn’t update the screen 10 times a second while scanning, reduces network bandwidth used

-x Don’t cross filesystem borders (don’t descend into a directory which is a mounted disk)

To use the program

ncdu -x -q

Sample Screenshot


Ubuntu / Linux Mint / LMDE : How to install a deb file via command line

The command to install a deb file via terminal is :

$ sudo dpkg -i package.deb

How to check your public ip address using terminal in Linux

In terminal type the following command :

curl ifconfig.me

If you receive an error about curl not being found or installed, install it by using the following command (on Debian based distros (Ubuntu, Linux Mint)):

sudo apt-get install curl

How to restore GRUB 2

To start with, if you are reading this post then you most likely know what GRUB is. However in the unlikely event that you dont know what it is, let me lay it out for you..

GRUB is a bootloader package from the GNU project. Many (but not all) linux distributions use GRUB as the bootloader. It is a multiboot bootloader and can contain entries of both Windows and GNU/Linux operating systems. Incidentally GRUB is the default bootloader that comes with Ubuntu.

Now suppose something happens to your GRUB (the bootloader) and it breaks or it doesnt remain the bootloader that your system uses anymore. This post explains how to restore GRUB as the default bootloader.

Please note that this guide applies only to GRUB 2.. if you want to install legacy GRUB, this wont work for you..

Also it is assumed that you dont have a seperate boot partition.

Anyways lets get started..

Firstly we would be needing a liveCD of Ubuntu.

  • Boot through the live CD
  • After booting into the liveCD enviroment, open a terminal
  • To install/repair/replace something as important as the bootloader, we first need to become the root user (known as admin to Windows users). To achieve this, type the following command in the terminal

sudo -i

The terminal shall then prompt you for the root password. Enter the root password.

  • Now that we have attained root rights, we can get along with the actual installation of GRUB2. The following commands assume that your Ubuntu is installed on /dev/sda7 partition. Replace the number 7 with the partition number where your Ubuntu is installed.
  • First mount the partition which has your Ubuntu installation (/dev/sda7 in my case). To do this type the follwing command in the terminal.

mount /dev/sda7 /mnt

  • Next install the GRUB2 using the following command

grub-install —root-directory=/mnt/ /dev/sdX

Here X is your drive alphabet. Ususally if only one drive is connected, then it is connected as /dev/sda. Still be sure about the drive alphabet before running this command.
 NOTE : There are two “-” before “root-directory” in last command. Somehow tumblr / wordpress is replacing it with a single “-“. Thanks to ‘dae’ for pointing it out.

  • Close the terminal and reboot the system. You GRUB bootloader is restored now and you should be able to boot into Ubuntu. If there are any other operating systems other than Ubuntu, you will have to update grub (after rebooting into Ubuntu) so that it can see search and save the information about the other operating systems that are on your system. In order to accomplish this, open a terminal and type the following command in the terminal.

sudo update-grub

I hope the above instructions helped you restore your GRUB2 bootloader. In case of any doubts/queries feel free to leave a comment for the same..


Ubuntu / Debian / LMDE : how to make system use ram instead of swap if there is free ram

In Debian based distros (Ubuntu, Linux Mint etc.), the tendency of the operating system to use swap memory is defined by the swappiness. You can view this value by executing the following command:

cat /proc/sys/vm/swappiness

The value of swappiness can range from 0 (least tendency to use swap) to 100 (high tendency to use swap). The default value is 60. A higher value of swappiness is usually desirable for servers. However for home users, a lower value is often favourable, especially when there is more than 512MB of ram on the system.

To change the value of swappiness, edit the /etc/sysctl.conf file. To do so type the following in the terminal:

gksudo gedit /etc/sysctl.conf

Add at the bottom of that text file, the following lines (copy and paste):

# Reduce the swap tendency
vm.swappiness = 10

(Source: community.linuxmint.com)


The solution that works for me…


Just follow the instructions in the post and you should have a working installation of GIMP-2.8