10 Lesser Known Commands for Linux

10 Lesser Known Commands for Linux

Linux is one of the most popular operating systems in the world. It’s an open-source platform that allows users to customize and personalize their computing experience in many ways. While most people are aware of the basics commands such as cd, ls, and mkdir for file and directory management, there are many other lesser-known commands that can make your work more efficient and effective. In this article, we’ll show you ten less popular yet essential Linux commands that you may not know.

1. Screen

Screen is a command that allows you to run a terminal session that’s detachable, even if the network connection to the server is dropped. This command is handy if you need to run a long task on a remote server that takes several hours to complete. With screen, you can start the task, detach from the session and leave the task running in the background.

To create a new terminal session using screen, type:

$ screen

To detach from the screen session, use the keyboard shortcut: Ctrl + A and then d.

To reattach to the screen session, type:

$ screen -r

2. Cowsay

Cowsay is a fun command that displays a cow with a speech bubble containing the text you input. It may not have any practical use, but it’s a fun way to make your friends or colleagues smile.

To use cowsay, install it using the command:

$ sudo apt-get install cowsay

Once installed, type the following command and add the text in the quotation marks:

$ cowsay "Hello, I'm a cow!"
  -------
< Hello, I'm a cow! >
  -------
    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

3. Cal

The Cal command displays a calendar for the current month. The current day is highlighted by default.

To use the Cal command, type:

$ cal

To display the calendar for a specific year, type:

$ cal -y (year)

For example, to display the calendar for the year 2022, type:

$ cal -y 2022

4. Rsync

Rsync is a command that allows you to copy and synchronize files between directories or servers. It works over ssh, which means it’s secure.

To use Rsync, type:

$ rsync source destination

For example, to copy files from the current directory to a directory in your home directory, type:

$ rsync -avz . ~

5. Mtr

Mtr stands for My Traceroute, and it’s an alternative to the tracert command used in Windows. It’s a network diagnostic tool that shows the path of network packets in real-time as they pass through different routers.

To use Mtr, type:

$ sudo apt-get install mtr

To run an Mtr command, type:

$ mtr (ip address)

For example, to trace the route for google.com, type:

$ mtr google.com

6. Ncdu

Ncdu stands for NCurses Disk Usage, and it’s a command-line tool that allows you to analyze disk space usage on your Linux system. It displays the usage in a tree-like format and allows you to navigate the file system and delete files or directories to free up space.

To use Ncdu, type:

$ sudo apt-get install ncdu

To run an Ncdu command, type:

$ ncdu

7. Htop

Htop is a process monitoring tool that allows you to view the processes running on your Linux system. It’s an alternative to the traditional top command but with a more user-friendly interface.

To install Htop, type:

$ sudo apt-get install htop

To run Htop, type:

$ htop

8. Gitk

Gitk is a graphical user interface tool for the Git version control system. It allows you to view the history of a repository, merge branches, and manage commits.

To use Gitk, install Git using the command:

$ sudo apt-get install git

Then, type the following command:

$ gitk

9. Fdisk

Fdisk is a command-line tool for disk partitioning. It’s useful when working with disk drives or USB drives, and you need to create or delete partitions.

To use Fdisk, type:

$ sudo fdisk (device)

For example, to partition a USB drive, type:

$ sudo fdisk /dev/sdb

10. Write

Write is a command-line tool that allows you to write messages to other users. It’s useful when working on a team on the same Linux system, and you need to communicate with each other.

To use Write, type:

$ write (username)

For example, to send a message to user “Tom”, type:

$ write tom

Then, type your message and send it by pressing “Ctrl + D”.

Conclusion

These ten lesser-known Linux commands will make your work more efficient and effective. Whether you’re a system administrator or just an average user, Linux has many powerful tools to make your computing experience better. So, explore these commands and see how you can use them to elevate your productivity.

Like(0)