Beginner

Recent in Beginner

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.

Tac - A command to print files in reverse

Probably one of the very first commands we come across while learning Linux/Unix is “cat”. It is used to concatenate multiple files and throw them all on the standard output i.e. print them on a terminal. Not many know this, but there exists a twin of cat, named “tac”, which is similar to it but does everything in reverse - kind of an “evil twin” ;).

Use dpkg to find out the files and directories created by a package at the time of install

Whenever we install an application, it automatically creates a lot of files and directories on our system related to it. For debian systems, we can use the dpkg tool to find out all the files created and added by an application at the time of install.

Different sections of manpages

We refer to manpages to get more information about the usage of a command or function but not many know that manpages are divided into 9 different sections (8 standard + 1 extra) based on the classification of commands or functions it is being used for.

How to connect/transfer files over ssh using Nautilus(file manager)

So, I am at home now a days for winter break and earlier today I was trying to transfer some Music videos I had on my Laptop to the home computer. I usually do that using scp but this time the data was pretty selective and hence writing a single command wasn’t that comforting. I was wondering if I could find something like winscp(on windows), using which I can easily make the transfer by visually selecting the files. While I was searching for it in the repos, I never realized how I have been under-estimating nautilus all this time.

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.

Difference between a root and non-root shell prompt

Have you ever looked at the command prompt carefully? Exactly! we usually don't care about the prompt. All we see is the little symbol at the end designating the prompt(usually its “$”) or at most look at the current working directory. This way sometimes we might not realize its actually a root prompt. This happens a lot when you are working at multiple terminals.

How to find out the various manpage sections to which a command belongs

So, last time we discussed different sections of man pages. We took the example of mkdir which had 2 manual pages - one as a command and the other as a system call. But what if we don't know the right manpage and want to find it out or just for kicks want to know under how many sections does a command come?(of course the usage would differ). This can be done easily using the whatis command.

How to find the exit code of the last executed command on bash using "?" environment variable

Every command or program returns an exit code to convey the execution status - success or failure. In Linux, programs return zero in case of success and a non-zero value in case of an error. If you want to find out the return value/exit status of the last executed command on bash, you can use the “?” environment variable.

Don't be misled from the file extension name. Get the actual file-type using file command

So, a friend of mine sent me a file with extension .run.gz saying that its a pretty good game. I decided to give it a try and started to extract it, but wait! I got the error saying that it is not a gzip archive. Something was definitely wrong. I was totally confused, thinking "What the hell!!" . The mystery was finally revealed when I ran file command. It stated that the file is a "POSIX shell script text executable".

Syndicate content