Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the rare Linux commands?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you the "rare Linux commands", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the rare Linux commands" this article.

twelve。 Command

Every command you type on the terminal is logged to history and can be re-invoked with the history command.

How to fool the history command? Hehe, you can do it easily. At the terminal, you only need to enter one or more spaces before typing the command so that your command will not be recorded.

Let's try five common Linux commands on the terminal and leave a blank before the commands (such as * * ls, pwd, uname, echo "hi" * * and who), and then check to see if these commands are recorded in history.

Avi@localhost:~$ ls avi@localhost:~$ pwd avi@localhost:~$ uname avi@localhost:~$ echo "hi" avi@localhost:~$ who

Now run the history command to see if the commands executed above have been logged.

Avi@localhost:~$ history 40 cd / dev/ 41 ls 42 dd if=/dev/cdrom1 of=/home/avi/Desktop/squeeze.iso 43 ping www.google.com 44 su

Did you see that the orders executed are not recorded? We can also trick history with another command, cat | bash, and the result is the same as above.

13. Stat command

The stat command in Linux is used to display the status information of a file or file system. When using a file name as a parameter, stat will display all the information about the file. Status information includes file size, block, permissions, access time, modification time, state change time, and so on.

Avi@localhost:~$ stat 34.odt File: `34.odt' Size: 28822 Blocks: 64 IO Block: 4096 regular file Device: 801h/2049d Inode: 5030293 Links: 1 Access: (0644) Gid: (1000 / avi) Gid: (1000 / avi) Access: 2013-10-14 00 avi 1740.000000000 + 0530 Modify: 2013-10-01 1515 purse 2017.000000000 + 0530 Change: 2013-10-01 15RM 2017.000000000 + 0530

14. +. And +.

The key combination above is not actually a command, but a shortcut that passes a command parameter to the prompt, passing the command in reverse order. Hold down Alt or Esc and press "."

15. Pv command

You may have seen simulated text in movies, especially Hollywood movies, such as real-time text input, and you can use the pv command to emulate any type of analog wind text output, including pipelined output. Pv may not be installed on your system, you need to use apt or yum to get the installation package, and then install pv to your machine.

Root@localhost:# echo "Tecmint [dot] com is the world's best website for qualitative Linux article" | pv-qL 20

Output styl

Tecmint [dot] com is the world''s best website for qualitative Linux article

16. Mount | colum-t

The above command lists all mounted file systems in a nice format and specification.

Avi@localhost:~$ mount | column-t

Output styl

/ dev/sda1on / type ext3 (rw,errors=remount-ro) tmpfson / lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on / proc type proc (rw,noexec,nosuid,nodev) sysfson / sys type sysfs (rw,noexec,nosuid,nodev) udev on / dev type tmpfs (rw,mode=0755) tmpfson / dev/shm type tmpfs (rw,nosuid,nodev) devpts on / dev/pts type devpts (rw,noexec,nosuid,gid=5 Mode=620) fusectl on / sys/fs/fuse/connections type fusectl (rw) binfmt_misc on / proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) nfsd on / proc/fs/nfsd type nfsd (rw)

17. Ctr+l command

Before moving on to the next step, let me ask, how do you clean up your terminal? Hehe, you will type "clear" at the prompt. Yes. Cleaning the terminal with the above command will be a thing of the past. All you have to do is press Ctr+l and see how it cleans up your terminal immediately.

18. Curl command

How do I check your unread email at the command line? This command is useful for people working on servers that do not have a graphical interface. It will ask for a password again during operation, and you do not need to hard-code your password on the above line, otherwise there will be other security risks.

Avi@localhost:~$ curl-u avishek1210@gmail.com-- silent "https://mail.google.com/mail/feed/atom" | perl-ne 'print\ t if / /; print" $2\ n "if / (. *) /;'

Output styl

Enter host password for user 'avishek1210@gmail.com': Gmail-Inbox for avishek1210@gmail.com People offering cars in Delhi-Oct 26 Quikr Alerts another dependency question Chris Bannister Ralf Mardorf Reco Brian Fran ç ois Patte Curt Siard berenger.morel Hi Avishek-Download your Free MBA Brochure Now... Diya ★ Top Best Sellers Of The Week, Take Your Pick ★ Timesdeal aptitude misconfigure? Glenn English Choosing Debian version or derivative to run Wine when resource poor Chris Bannister Zenaan Harkness Curt Tom H Richard Owlett Ralf Mardorf Rob Owens

19.screen command

The screen command disconnects a long-running process under a session and can connect again, and provides flexible command options if necessary.

To run a long process, we usually execute:

Avi@localhost:~$. / long-unix-script.sh

Lack of flexibility requires the user to persist the current session, but if we execute the above command is:

Avi@localhost:~$ screen. / long-unix-script.sh

It can be disconnected or reconnected in different sessions. Press "Ctrl + A" while a command is being executed and then press "d" to disconnect.

Reconnect to run:

Avi@localhost:~$ screen-r 4980.pts-0.localhost

Note: here, the later part of this command is screen id, which you can see with the 'screen-ls' command. To learn more about screen commands and their usage, please read some of our help articles: examples of 10 screen commands.

20. File

No! Writing the above command is not a clerical error. 'file' is a command that provides information about file types.

Avi@localhost:~$ file 34.odt 34.odt: OpenDocument Text

21. Id

The above command prints the id of real and valid users and groups.

Avi@localhost:~$ id

Output styl

Uid=1000 (avi) gid=1000 (avi) groups=1000 (avi), 24 (cdrom), 25 (floppy), 29 (audio), 30 (dip), 44 (video), 46 (plugdev), 109 (netdev), 111 (bluetooth), 117 (scanner) are all the contents of this article, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report