My family bought our first personal computer in the Windows dominated era. So, of course, Windows was the first operating system we started using. Not just that, we even used to enjoy it unless we started learning Linux and its various flavours. Why is it so? Well, I found it better than Windows in most of the cases. (Here is an article which discusses some reasons that make Linux a better operating system for users). But one thing remained insatiable was what makes typing the commands on Linux command line a better experience than clicking impressive GUIs?
Linux Command Line vs GUI
As the saying goes, “we learn it best when we do it ourselves”, therefore after switching to Linux I personally felt the efficiency and quickness of tasks getting done through command line verses through graphical user interface (CLI vs GUI). And the major reason being, even a mouse click generates an action which will trigger the execution of the same executable as we do through the command directly. Hence, running the same task through GUI involves an extra overhead of calculating the mouse pointer coordinates, raising a click action etc. In case, there are input options required, it adds on to the overhead. All this handling of the overhead takes some time at the cost of impressive visuals and to avoid typing.
Well, to talk about deep driven merits of using command line as compared to GUI, here is a synopsis of abstract points:
As you start spending more and more time working on Linux command line, you tend to learn some cool tricks that make your life easy and save you lot of time. I have been working on Linux command line for many years now and I have learned a lot of Linux command line tricks. Here in this article, I will discuss some Linux command line tricks that I find worth using in my day to day command line activities.
NOTE – All the examples in this article are tested on bash shell.
Have you ever seen a train running on Linux command line? Have you ever seen ‘Tom and Jerry’ on Linux command line? Well, working on Linux command line is not that serious always. There lies a fun factor too. Here in this space, we shall discuss the idiosyncrasies of Linux command line.
Assumption: Ubuntu Linux is used for all the examples in this article. The command line utilities described in this article may or may not be present by default on your Linux system.
I have been a Linux command line addict for many years now. Though I use Ubuntu 12.04 these days but still I spend most of the time on command line. I like to do most of my tasks through command line only. While I am pretty happy with what all I am able to do through command line but still there are few tasks for which I have to use other (GUI based) applications. One of these tasks was taking a screen-shot. I have always used graphical applications for taking screen-shots on Linux. Honestly speaking I never thought that Linux command line can be used to take a screen shot until I encountered the scrot utility.
The scrot utility can be used to take screen-shots from command line. There are various options available with this command that make this utility equally powerful and flexible as its graphical peers. In this article we will discuss some important and useful features of scrot utility through practical examples.
Generally, on any operating system, we say we have so many programs running. These running programs introduce the concept of processes. Let’s Define as to what is a process – A process is a program in execution.
Robert Love expresses his definition of a process in one of his books as :
The Process is one of the fundamental abstractions in Unix Operating Systems, the other fundamental abstraction being files
Linux is a multi-user and multi-tasking operating system(seemingly, discussed later in the article). A Linux process is a program in execution on a Linux system. Therefore, whenever a program is executed, a new process is created. A process also consumes resources like the file system, memory or other CPU resources. This gives rise to the need of process management in Linux.
Have you ever been caught in a situation where, through command line, you had to backup or delete files that were created in a specified time period?
Have you ever got frustrated when your image viewer program mixed up your latest photographs with old photographs just because your camera messed up with the time stamps of the latest photographs at the time when they were taken?
Or, do you just want to play cool in front of your friends or peers by accessing a file or document even before it was created?
Well, if you have been through the above mentioned or similar situations and want to know how can we use a couple of easy command line utilities in Linux to solve these problems then it’s time for you to read on.
Iproute2 (or Iproute) consists of a variety of utilities for controlling TCP / IP networking and traffic control in Linux. It is actively maintained and frequently updated, and now considered the preferred package for modern network technologies which includes important network tools such as ip and tc, used for IPv4 and IPv6 configuration and traffic control. It currently replaces the outdated Net-Tools package encompassing commands such as ifconfig, route, arp, etc, which are now known to be mostly inadequate as they provide limited features.
To give you an idea just how obsolete the Net-Tools package is, it should be noted the last verified update was back in April, 2001. A common view among many developers and users is that these former Net-Tools utilities should be deprecated, however, most Linux distros still include them as old habits are hard to break. It is suggested, now is the time to familiarize yourself with some of the most common commands of the newer, feature packed Iproute2 utilities package to be more current with the times.
For a Linux user, fuser is an efficacious utility. It stands for file user and as it suggests, it tells us the processes which are using the file. In this article we will study when and how to use Linux fuser command through practical scenarios and examples. Since in Linux everything is a file, we shall see later in the article, how it is used for directories and sockets too.
Hexdump is a Linux command that provides many options to dump file contents. It can dump file contents into formats such as hexadecimal, octal, ASCII, decimal. This command takes input either from a file or standard input. Hexdump is very helpful utility for debugging and verifying file contents written by any application program. In this article, we will first understand the basic usage of hexdump and then we will discuss some practical scenarios where hexdump command comes in really handy.
Well known is the use of Iptables (read here) with Linux as a secure and effective firewall for your network connections, to customize and regulate all incoming, forwarded, and outgoing network traffic, and as a router or gateway for an internal LAN (Local Area Network). In addition to these and many more functions, Iptables can also be used to mangle, modify or alter parameters within the IP Header of a given Network Packet when necessary. The packets can be mangled in the built-in chains of PREROUTING (altering incoming packets prior to routing), INPUT (for packets coming into the box itself), FORWARD (for altering packets being routed through the box), and OUTPUT (for altering locally-generated packets before routing) and POSTROUTING (for altering packets as they are about to go out).