FreeBSD has many simple and powerful commands FreeBSD with many simple and powerful commands to make your computer work easier. Regardless of your experience in any UNIX system, you will find new shortcuts and new methods for work work. In this article, we will discuss the command to help you remember who you are, where are you, how to think about the problem and complete tasks like UNIX ghosts! I like the concept of virtual terminal, and I usually run all 8 terminals and XWindows sessions. Typically, I will run a PPP session, a terminal that opens the mail client, a few different open manuals, and runs the terminal with the root, and the terminal that runs the command as a normal user. Of course, the more confusing the function, the more chaos. I will use some command to help me solve the chaos. If I forgot, the PrintscrN key scrolls all the virtual terminals in an ascending order. If you don't run a X Window session, you can continue to repeat 1 to 8 terminals. Otherwise, it will stop on the terminal 9, which is the X server. If I entered a terminal and want to know which terminal is this, you can use the TTY command: TTY / DEV / TTYV4, it is actually the 5 virtual terminal because these terminals are starting from 0. If you leave the terminal, you can return it with ALT-F5. If I want to know which user is on the terminal, I can use whoami: whoamiroot If I want to know who I log in into the terminal, I can use Who: Whogenisis TTYV0 JUN 3 15: 45Geniis TTYV1 JUN 3 15: 46Geniis TTYV2 JUN 3 21 : 09Genisis TTYV3 JUN 3 21: 10Genisis TTYV4 JUN 3 21: 27Genisis TTYV5 JUN 4 09: 40Genis TTYV6 JUN 4 09: 43Geniis TTYV7 JUN 4 10:46 Note the difference between WHO and WHOAMI. In TTYV4, I was originally logged in as Genisis and then became a super user. The who command tells you who has information on the login command interpreter without returning the non-login interpreter. That is, because my X WINDOW session is not a login interpreter, TTYV8 will not display in the output information. If I forgot in which directory you can use, you can use the PWD: PWD it will display my current work directory: / usr / home / genisis good experience is: Don't use the PWD to check your actual location Create or delete files before.
Now, if I forgot Time: Datesun Jun 4 11:15:46 EDT 2000 or worse, forgot Today: Cal June 2000su Mo Tu We TH fr Sa 1 2 34 5 6 7 8 9 1011 12 13 14 15 16 1718 19 20 21 22 23 29 30 or need to know 2020 Christmas? Which day: CAL 12 2020 December 2020su Mo Tu We TH fr Sa 1 2 3 4 56 7 8 9 10 11 1213 14 15 16 17 18 1920 21222 23 24 25 21. Declaration of Independent Declaration That week: CAL 07 1776 July 1776su Mo Tu We TH fr Sa 1 2 3 4 5 67 8 9 10 11 12 1314 15 16 17 18 19 2021 22 23 24 25 26 2728 29 30 31 Two tips about CAL can also make your friends to be very surprised; try this: CAL 9 1752 September 1752su Mo Tu We TH fr SA 1 2 14 15 1617 18 19 20 21 22 2324 25 26 27 28 29 The date of the vacancy is due to the switching of the Caesarism. Also: NCAL-EAPRIL 23 2000 This will show Jesus to the day; you can know the Calendar Calendar in the Orthodox Church with -O. At this point, you may think that I must be a very good typo. Let's take a look at the history list: h 110date> / usr / home / genis / Cal 111 Cal> / usr / home / genisis / CAL 112cal 12 2020> / usr / home / genisis / CAL 113cal 07 1776> / usr / home / Geniis / Cal 117cal 9 1752> / usr / home / genisis / cal 122ncal -e> / usr / home / genisis / cal 134h> / usr / home / genisis / CAL I hate typing, but also used so many redirection . If you want to save the result on the command line to use this redirector; its syntax is always the same: command> filename, because I want you to see the output of each command in the above historius, They are redirected to a file. Then post it to my document. Note I covered the same files in seven times; because I only used a redirector. Let us assume that you have issued a problem in the FreeBSD Q & A list, then someone will provide you with the output content of Uname -a, Dmesg, and FSTAB. You can use> Create three files and put them to your email document. But you can also redirect all three output to a file, just replace it with >> This redirector is replaced: uname -a> / usr / home / genis / helpdmesg >> / usr / home / genisis / helpMore / ETC / fstab >> / usr / home / genisis / help If I now type: more / usr / home / genisis / help, you will see the output of the above three files. Let us look more carefully: I only use one in the uname -a command. Because I am creating a new file and does not override its own content.
Because I used it in the dmesg command >>, I won't cover the part of the uname -a in that file. Note that I need to use more commands for / etc / fstab. If I use: fstab >> / usr / home / genisis / help, fstab: command not found: Error message will appear. You can't redirect files; you can only redirect command output. In this case, the command of reading / etc / fstab is more; the result of reading will be redirected to / usr / home / genis / help. This has successfully sent three commands to a file without overwriting the output of each command. But why should I put three orders? It is possible to have a method to complete these work with an order. If I hit: uname -a dmesg more / etc / fstab >> / usr / home / genis / help2, usage: uname [-amnrsv] I will receive this information. Look at this command; it does have everything you have to do, but which one can you say is the command, which one is the switch, which is the file? If you feel confusing here, imagine how your command interpreter will feel when trying to explain your intentions. So we need some ways to separate the command; try this: uname -a; dmesg; more / etc / fstab >> / usr / home / genis / help3 This will send the uname -a and dmesg output to the terminal; if You use this command: more / usr / home / genisis / help3 You will only see the output of the more / etc / fstab command. Therefore, we have been a bit close. We have separated these commands, now let the command interpreter know that the three outputs we want are sent to that file, not the output of the command. Finally, try again: (uname -a; dmesg; more / etc / fstab) >> / usr / home / gENIS / help4more / usr / home / genisis / help4 you will get the desired result. The parentheses above tells the command interpreter, you want to run the command in parentheses, and then redirect all the output to that file. FreeBSD also has several tools for finding information. Which tool to use depends on what you are looking for. If you are looking for an application, you can use whereis: whereis lsls: / bin / ls If you have to find a file, you can use locate: locate fstab / etc / fstab if you have something, but I don't know what it is. , You can use whatis: whatis lsls (1) - list directory contentswhatis fstabfstab (5) - static information about the filesystems Note What IIS This command contains the number of the man page in parentheses. If you want to add additional information on the above two things, you can use: man 1 lsman 5 fstab, but you need to find a specified text? Just use the GREP tool, it has a very simple syntax: grep whatzyou'relookingfor filename lets us assume that I can't keep the BPF's device in the default end of FreeBSD 4.0.