Following up on our earlier dialogue of lesser-known Linux instructions, this text will discover extra hidden instructions, that are extraordinarily helpful for managing your Linux system from the command line.
12. <house> Command – Hiding Instructions from Linux Historical past
Each command you kind within the terminal will get recorded within the historical past and might be retried utilizing the historical past command.
How about dishonest historical past command? Yeah, you are able to do it, and it is rather simple. Simply put a number of white house earlier than typing a command within the terminal and your command received’t be recorded.
Let’s give it a attempt. We’ll enter 5 frequent Linux instructions (ls, pwd, uname, echo, and who) within the terminal with a number one house and verify if these instructions are logged within the historical past or not.
ls
pwd
uname
echo “hello”
who
Now run the ‘historical past‘ command to see whether or not these above executed instructions are recorded or not.
historical past
You see our final executed instructions are usually not logged. we will additionally cheat historical past by utilizing an alternate command ‘cat | bash‘after all with out quotes, in the identical approach as above.
13. stat Command – Present File Standing Data
The stat command in Linux shows the standing info of a file or filesystem. The `stat` command exhibits a variety of details about the file whose title is handed as an argument.
Standing info contains file measurement, blocks, entry permissions, and the date and time of the final entry, modification, and alter.
stat lists.txt
![Show File Status Information](https://www.tecmint.com/wp-content/uploads/2013/10/Show-File-Status-Information.png)
14. Utilizing <Alt> + . and <Esc> + . to Recall Final Command Arguments
The above key mixture shouldn’t be really a command however a tweak that places the final command argument on the immediate, within the order of the final entered command to the earlier entered command.
Simply press and maintain Alt or Esc and proceed urgent…
In case your final command was:
ls /dwelling/person/paperwork
Urgent Alt + . or Esc + . within the terminal will insert /dwelling/person/paperwork on the immediate.
15. Simulating Textual content with the pv Command
You might need seen textual content being simulated in motion pictures, particularly Hollywood motion pictures, the place it seems as whether it is being typed in real-time. You may simulate any sort of textual content and output on this vogue utilizing the pv command, as proven within the instance above.
The pv command won’t be put in in your system, and you could want to make use of your bundle supervisor to put in the required packages.
sudo apt set up pv [On Debian, Ubuntu and Mint]
sudo yum set up pv [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
sudo emerge -a sys-apps/pv [On Gentoo Linux]
sudo apk add pv [On Alpine Linux]
sudo pacman -S pv [On Arch Linux]
sudo zypper set up pv [On OpenSUSE]
sudo pkg set up pv [On FreeBSD]
Now you need to use pv together with echo to simulate the typing of a message. Right here, -q suppresses the progress bar and -L 20 units the typing pace to twenty bytes per second.
echo “Tecmint [dot] com is the world’s finest web site for qualitative Linux article” | pv -qL 20
![Simulating Text in Terminal](https://www.tecmint.com/wp-content/uploads/2013/10/Simulating-Text-in-Terminal.png)
16. Formatting Mounted Filesystems with mount and column
The command mount | column -t shows an inventory of all mounted filesystems in a neatly formatted desk.
mount | column -t
It will present the record of mounted filesystems in a clear, organized format with columns correctly aligned, making it simpler to learn and interpret the output.
![Show Mounted Filesystems in Table Format](https://www.tecmint.com/wp-content/uploads/2013/10/Show-Mounted-Filesystems.png)
17. Clearing Your Terminal with Ctrl+L Command
Earlier than we proceed, let me ask you ways you clear your terminal. Do you kind clear on the immediate? Effectively, the Ctrl+L keyboard shortcut performs the identical motion of clearing your terminal .
Simply press Ctrl+L and watch the way it clears your terminal immediately.
18. Checking Unread Mail with curl Command
The curl command can be utilized to verify your unread mail from the command line, which is very helpful for these engaged on headless servers.
Word that storing your password within the command line straight shouldn’t be really helpful. As a substitute, curl will immediate you on your password securely.
curl -u username:password https://mail.instance.com/api/unread
Within the above command, substitute username, and password and regulate the URL to match your mail server’s API endpoint.
19. Utilizing ‘display screen’ to Handle Lengthy-Operating Processes
The display screen command makes it doable to detach a long-running course of from a session that may once more be reattached, as and when required which gives flexibility in command execution.
To run a course of (lengthy) we typically execute it as:
long_running_command
Which lacks flexibility and desires the person to proceed with the present session, nonetheless, if we execute the above command as.
display screen long_running_command
It may be de-attached or re-attached in several periods. When a command is executing press “Ctrl + A” after which “d” to de-attach.
To connect run.
display screen -r 4980.pts-0.localhost
Word: Right here, the later a part of this command is display screen id, which you will get utilizing the ‘display screen -ls‘ command.
20. Establish File Varieties Utilizing file Command
The file command is used to find out the kind of a file by inspecting its contents slightly than its title or extension.
It analyzes the file’s content material and gives an outline of its kind.
file lists.txt
lists.txt: ASCII textual content
21. Discover Consumer and Group ID’s
The id command shows details about the present person or a specified person, together with their person ID (UID), group ID (GID), and group memberships.
id
![Show User and Group IDs](https://www.tecmint.com/wp-content/uploads/2013/10/Show-User-IDs.png)
Conclusion
That’s all for now. With the success of this text and the earlier ones within the collection, I hope you’ve loved exploring these lesser recognized Linux instructions. Keep tuned for extra insightful content material.
Within the meantime, you may discover these articles fascinating:
Don’t overlook to share your precious suggestions within the feedback!