Most PC users, whether familiar with Unix or not, know about Zip files. The zip command offers compression that is based on the algorithm from the PC standard PKZip program. The zip and unzip programs work exactly as you might expect them to: zip [filename] to compress a file with zip, and unzip [filename.z] to […]
Archives for April 2022
How to disable SSH host key checking in Linux
SSH communication is secured using public key cryptography. When a user connects to the SSH-server using SSH-client for the first time, the SSH program stores the SSH-server public key in the user’s home directory inside a file, known_hosts, in a hidden folder named ~/.ssh/, as shown in the following screenshot: Now, subsequently, whenever the ssh-client […]
Allow root ssh login with public key authentication only
The Basics SSH server has multiple ways of authenticating a client connecting to it. The most popular method is password-based authentication as it is the easiest one, however it is not so secure. Passwords are exchanged with secure mechanisms, however, due to ease of use they are generally not complex or long. This enables the […]
How to convert text files to all upper or lower case
As usual, in Linux, there are more than 1 way to accomplish a task. To convert a file (input.txt) to all lower case (output.txt), choose any ONE of the following: To convert a file (input.txt) to all lower case (output.txt) 1. dd: You may have used dd for many other purposes but it can be […]
How to Display Routing Table in Linux
To display the kernel routing table, you can use any of the following methods: route List all the current static routes: $ sudo route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 You need […]
Log watching using tail or less
Using tail The tail utility is similar to head but by default displays the last ten lines of a file. Depending on how you invoke it, this utility can display fewer or more than ten lines. You can monitor lines as they are added to the end of the growing file named logfile by using […]
How to grep with color output
One of the powerful and widely used command in shell is grep. It searches in an input file and matches lines in which the given pattern is found. By default, all the matched patterns are printed on stdout that is usually terminal. We can also redirect the matched output to other streams such as file. […]
make: Nothing to be done for `default’
Most programs build with a simple, two-command sequence: $ ./configure $ make The configure program is a shell script that is supplied with the source tree. Its job is to analyze the build environment. configure command creates several new files in our source directory. The most important one is Makefile. Makefile is a configuration file […]
How to show line numbers in Gedit
In the GNOME Shell desktop environment, accessing gedit is fairly straightforward. Click the Activities icon in the upper-right corner of the desktop window. When the search bar appears, click within the bar to access it, type gedit or text editor, and then click Text Editor. If desired, you can start gedit from the command-line prompt […]
printk and console log level
printk() is to the kernel what printf() is to the userspace. Lines written by printk() can be displayed through the dmesg command. Depending on how important the message you need to print is, you can choose between eight log-level messages, defined in include/linux/kern_levels.h, along with their meaning. The syntax of printk is: printk (“log level” […]