Early in my journey of learning Linux, I first learned how to use the command line and learned about superscripts. That's what makes Linux different. I may not use it graphical user interface (GUI), but can still operate comfortably. Many computers run Linux headless and you can complete all administrative tasks on the command line. It uses many basic commands such as ls, ls-l, ls-l, cd, pwd, top, and many more.
Join the channel Telegram belong to AnonyViet 👉 Link 👈 |
Shell metascript on Linux
You can expand each of those commands through the use of superscripts. I don't know what you call these things, but superscripts have made my work much easier and faster.
Vertical dash |
Let's say you want to know all the versions of Firefox running on your system. Then you can use the ps command with an -ef to list all versions of the program running on the system. But now I only want to see cases related to Firefox, so I will use the hyphen superscript | results for grep, to search for patterns.
$ ps -ef | grep firefoxÂ
Output redirection >
Another favorite superscript of mine is the > output redirection. I use it to print the results of all the cases that Intel mentioned as the results of the dmesg command. You may find this very useful in troubleshooting hardware problems. This super character will redirect the result of the command to the amd.txt file.
$ dmesg | grep amd > amd.txt $ cat amd.txt [ 0.897] amd_uncore: 4 amd_df counters detected [ 0.897] amd_uncore: 6 amd_l3 counters detected [ 0.898] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
Asterisk *
The asterisk * or wildcard is a favorite when searching for files with the same extension — like .jpg or .png. First, I access the Picture folder on the system and use the following command:
$ ls *.png BlountScreenPicture.png DisplaySettings.png EbookStats.png StrategicPlanMenu.png Screenshot from 01-24 19-35-05.png
Tilde ~
The tilde ~ is a quick way to get back to your home directory on a Linux system by entering the following command:
$ cd ~ $ pwd /home/don
Dollar symbol $
The $ symbol is used to match patterns, it will take any string that ends with a given string. For example, when using the super character | and $:
$ ls | grep png$ BlountScreenPicture.png DisplaySettings.png EbookStats.png StrategicPlanMenu.png Screenshot from 01-24 19-35-05.png
Caret ^
The ^ symbol restricts results to items starting with a certain string. For example, when using the super character | and ^:
$ ls | grep ^Screen Screenshot from 01-24 19-35-05.png
In addition, you can also see 10 interesting Terminal programs on Linux that you should try when you're bored here.