commands

Use free with '-s' option to get a continuous update of memory usage info

Free command gives a concise information of the memory usage of the system. The program displays the info once and exits. You can use the ‘-s’ option to update the output continuously. Unlike top command, free doesn’t use ncurses, hence instead of a page refresh emulation its simply continuous printing. But it sure does the job.

How to: Get the information of your Computer's Hardware components using Dmidecode command

Dmideocde is a wonderful utility to get detailed information about your system’s hardware components. It extracts the information from the computer’s Desktop Management Interface(DMI) and displays in a human readable format. Please note that, it doesn’t probe the devices in order to gather the information, it just reads it from some data structures.

The history of the origin of grep command

Grep is one of the most important tools for a shell user. When it comes to retrieving required data from a bulk of text, grep is your best bet. Its very flexible, powerful and as I came to know today, has an interesting story too.

It all started a long time ago. With the increasing popularity of regular expressions, the text editor “ed” included a functionality using which one can print the lines, in the currently edited file, which matches a regular expression.

Correct your habit of incorrectly typing "ls" using the program "sl"

Almost everyone of us would have made the mistake of incorrectly typing “sl” or “LS” instead of a simple “ls”. Seriously! how difficult could it be to type those two letters? But we keep making the same mistake over and over. In order to correct this problem, there is a wonderful program name “sl”. It shows a small animation of a steam locomotive(abbr. sl) every time we type “sl” or “LS”.

Howto: Find the uptime and system load of a Linux machine using uptime command

Uptime is the amount of time a machine has been up and running, providing all its services without any downtime. For a linux machine, this information can be found out using the “uptime” command. Along with the uptime, this command also tells you how many users are currently logged in and the load on the system in the past 1, 5 and 15 minutes.

Use the lscpu command to get CPU/Processor information on Linux

There are a lot of ways to get information about your system’s cpu. You can either dump the contents of /proc/cpuinfo file, lshw or my recent discovery "lscpu". This utility gathers all the data from sysfs, /proc/cpuinfo file as well and shows it in a human readable format.

How to - Use the Readlink command to find the canonical filename of a symbolic link

Sometimes you may encounter a chain of files linked together using symbolic links. Readlink is a tool that can follow the chain and help you find out what is at the other end of it, the absolute file. Lets take an example of the Debian Alternate system. The file /usr/bin/editor is symlinked to /etc/alternatives/editor which in turn is linked to the actual editor binary - /bin/nano.

How to exclude a set of files from disk space usage calculation using du

We have already discussed the most common options used with du - a tool to check/calculate file space usage. In its most basic form, du tells you the size of all the files in a given directory. Using -s option it sums up the total size of a directory, but what if we don’t want to include a set of files while calculating the utilized space.

How to: Get the Inode utilization data of a filesystem using df command

When we talk about a file in ex2/3/4 filesystems, it consists of two kinds of information - filename and inode. The latter is a special data structure to store information about the file - file type, size, ownership, access information(read,write,execute bits), location of the file content etc. Such type of information is also known as metadata.

Use Tail command to view growing/changing files in real time

Many a times you will feel the need to view a constanly updating file. This is a common case with logs. People usually think that tail command is only used to view the last parts of a file, but it even provides you with the ability to view growing/changing files.

Please note that, by growing I mean files to whom data is being appended constantly. Using the “-f” option, tail lets us view the data that is being added to the file in real time.

Syndicate content