10 Must-Know Linux Commands You Probably Missed – Part 4

Welcome back to our ongoing journey through the world of powerful but often overlooked Linux commands. If you’ve been following along, you already know there are lots of handy tools hidden in the terminal, just waiting to make your life easier.

In this fourth installment, we’re bringing you yet another batch of underrated Linux commands that pack a punch. These are tools that many users, especially beginners, might not stumble upon during regular use, but once discovered, they quickly become indispensable.

If you’ve missed the previous parts, make sure to check them out:

Let’s dig into Part IV and uncover a few more hidden gems that can sharpen your command-line skills.

32. strace Command

The strace is a debugging tool that is used primarily for troubleshooting purposes in Linux, which might not be installed by default on your system, and you may need to use apt or yum to install the required package.

To trace a command execution, invoke:

strace pwd
Trace Linux Commands
Trace Linux Commands

The strace command accepts a lot of arguments and has many options; refer to the man page for detailed information.

man strace

33. disown -a && exit Command

Most system administrators use the screen command to control jobs running in the terminal background. If you have a long-running job and want to detach from the terminal, you typically use the screen command to do this.

However, if you don’t know how to use screen, the disown command comes to the rescue, which is used to keep jobs running in the background even after you close the terminal session.

The syntax to disown all background jobs and exit the terminal is:

command & disown -a && exit

To detach a specific long-running job, use the jobs command to find the job number, then run disown %n, where n is the job number.

jobs             # List background jobs to find job number
disown %n        # Disown the job with job number 1

To verify that the job is actually running, use the ps or top command. The nohup command is an alternative to the disown command.

34. Display Date on the Terminal

The following command is a combination of several commands, essentially, a small script. For someone working in a shell or terminal without a graphical user interface (GUI), checking the current system date can be a tedious task, as it typically requires typing the date command.

To make this easier, execute the following command in your terminal, which will display the current date and time in the top-right corner of the terminal window and update it every second:

while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &

Explanation:

  • sleep 1: Waits for 1 second between updates.
  • tput sc and tput rc: Save and restore the cursor position.
  • tput cup 0 ...: Moves the cursor to the first row, near the right edge of the terminal.
  • date: Displays the current date and time.
  • &: Runs the loop in the background so you can continue using the terminal.

Note: You may need to adjust the value 29 in $(tput cols)-29 depending on your terminal width and the length of the date string for optimal alignment.

35. watch -t -n 1 “date +%T | figlet”

Remember the figlet command we mentioned in our earlier article “20 Funny Commands of Linux”? It’s a fun little tool that prints text in large ASCII letters.

This time, we’re combining it with the watch command to create an animated digital clock in your terminal.

Make sure you have figlet installed on your system.

sudo apt install figlet      # For Debian/Ubuntu
or
sudo yum install figlet      # For RHEL/CentOS

Then run:

watch -t -n 1 "date +%T | figlet"

That’s it! You’ll see a digital-style clock updating every second in your terminal.

36. host and dig Commands

The host and dig commands are useful DNS lookup utilities in Linux. While they are not entirely obscure, they are often underutilized despite their effectiveness in diagnosing DNS-related issues.

host Command

The host command is a simple utility used to perform DNS lookups, which converts domain names into IP addresses and vice versa.

host www.google.com

Output:

www.google.com has address 142.250.64.100
www.google.com has IPv6 address 2607:f8b0:4007:80f::2004

This result shows the IPv4 and IPv6 addresses associated with the domain www.google.com.

dig Command

The dig (Domain Information Groper) command is a powerful and flexible DNS lookup tool, which provides detailed information about DNS queries and is often used for debugging and testing DNS configurations.

dig www.google.com

37. dstat Command

The dstat command is a versatile and powerful tool used for generating real-time system resource statistics. It provides information on CPU, memory, disk I/O, network activity, and more, all in a single, color-coded output, which makes it especially useful for performance monitoring and troubleshooting.

dstat may not be installed by default on your system. Use one of the following commands based on your Linux distribution:

sudo apt install dstat         [On Debian, Ubuntu and Mint]
sudo dnf install dstat         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
sudo emerge -a sys-apps/dstat  [On Gentoo Linux]
sudo apk add dstat             [On Alpine Linux]
sudo pacman -S dstat           [On Arch Linux]
sudo zypper install dstat      [On OpenSUSE]    
sudo pkg install dstat         [On FreeBSD]

Once installed, you can start using dstat with a simple command:

dstat
dstat - Monitoring System Resources
dstat – Monitoring System Resources

38. bind -p Command

The bind -p command displays all the current key bindings (keyboard shortcuts) available in the Bash shell, which allow you to customize and view how certain key combinations behave in the shell.

bind -p

This will output a list of all readline key bindings, such as:

"\C-a": beginning-of-line
"\C-e": end-of-line
"\C-k": kill-line
...

Each line shows a key combination and the command it is bound to.

39. touch /forcefsck

The command below creates an empty file named forcefsck in the root directory (/), which acts as a flag that instructs the Linux system to perform a file system check (fsck) on the next reboot.

touch /forcefsck

When the system boots, it detects this file and runs fsck on the relevant partitions before mounting them, which helps fix any file system inconsistencies.

40. ncdu – NCurses Disk Usage

ncdu is a fast, ncurses-based disk usage analyzer — a great alternative to du with an interactive interface.

sudo apt install ncdu         [On Debian, Ubuntu and Mint]
sudo dnf install ncdu         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
sudo emerge -a sys-apps/ncdu  [On Gentoo Linux]
sudo apk add ncdu             [On Alpine Linux]
sudo pacman -S ncdu           [On Arch Linux]
sudo zypper install ncdu      [On OpenSUSE]    
sudo pkg install ncdu         [On FreeBSD]

Run it in a directory to see disk usage and navigate interactively:

ncdu

41. shred Command

shred securely deletes files by overwriting them multiple times, preventing recovery.

shred -u filename

The -u deletes the file after shredding, which is much safer than a simple rm when deleting sensitive data.

These hidden Linux commands are really helpful and can make your work in the terminal easier and faster once you start using them.

💡 Want to Level Up Your Linux Skills?

Check out Pro.Tecmint.com for ad-free reading, exclusive guides, downloadable resources, and certification prep (RHCSA, RHCE, LFCS) - all with lifetime access.

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

10 Comments

Leave a Reply
  1. “35. Display Date on the Terminal”.

    What is more tedious? Typing in 4 characters ‘DATE‘ and getting back the current date and time, or having to type in a series of intricate commands (susceptible to finger checks)? Yes, the string of commends can be saved as a script but then you still have to type in the name of the script on the terminal (more finger checks).

    “38. host and dig Commands”

    You explain what the ‘host’ command is used for. You don’t explain what the ‘dig’ command is used for.

    “41. touch /forcefsck”

    Maybe you should explain that the ‘touch’ command is used generally to create files/directories and then explain the specific ‘/forcefsck’ example.

    Reply
  2. Hi tecmint team

    I think you should post commands which used frequently in daily work :D

    For example command number 37 :D

    Thanks for your useful tutorial ^_^

    Reply
    • Run the ‘passwd username’ to command to reset current logged in user. Make sure you must be root user to perform such command.

      Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

OSZAR »