In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what are the Linux translation terminal commands". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Command line daily shortcut keys
The following shortcuts are very useful and can greatly improve your productivity:
CTRL + U-cut the contents in front of the cursor
CTRL + K-cut the cursor to the end of the line
CTRL + Y-paste
CTRL + E-move the cursor to the end of the line
CTRL + A-move the cursor to the beginning of the line
ALT + F-Jump to the next space
ALT + B-Jump back to the previous space
ALT + Backspace-deletes the previous word
CTRL + W-one word before the cut cursor
Shift + Insert-paste text into the terminal
So to make the above easier to understand, take a look at the following line of command.
Sudo apt-get intall programname
As you can see, there is a spelling error in the command, and "intall" needs to be replaced with "install" in order to execute properly.
Imagine that now that the cursor is at the end of the line, there are many ways to return it to the word install and replace it.
I can press ALT+B twice so that the cursor will be in the following position (here refers to the location of the cursor).
Sudo apt- Get ^ intall programname
Now you can press the arrow keys twice and insert "s" into the install.
If you want to copy the text from the browser to the terminal, you can use the shortcut key "shift + insert".
2. SUDO!!
If you don't know this order, I think you should thank me, because if you don't know, you will be miserable every time you see "permission denied" after entering a long list of commands.
Sudo!!
How to use sudo!? It's simple. Imagine that you just entered the following command:
Apt-get install ranger
There is bound to be a "Permission denied" unless you have logged in to a highly privileged account.
Sudo!! The last command is run in the form of sudo. So the last order went like this:
Sudo apt-get install ranger
If you don't know what a sudo is, poke it here.
3. Pause and run the command in the background
I once wrote a guide on how to run commands in the background of a terminal.
CTRL + Z-pause the application
Fg-call the program back to the front desk
How to use this technique?
Imagine you are editing a file with nano:
Sudo nano abc.txt
In the middle of editing the file, you realize that you need to type some commands on the terminal right away, but nano runs in the foreground so that you can't type.
You may think that the only way is to save the file, exit nano, and reopen nano after running the command.
In fact, as long as you press CTRL + Z, the command of the front desk will be paused and the screen will switch back to the command line. You can then run the command you want, and type "fg" in the terminal window after the command has been run to return to the previously paused task.
One interesting attempt is to open a file with nano, type something, and then pause the session. Then open another file with nano, type something, and then pause the session. If you type "fg" you will return to the second file opened with nano. Only by quitting nano and typing "fg" will you return to the first file you opened with nano.
4. Use nohup to still run commands after logging out of a SSH session
The nohup command is really useful if you log in to another machine with ssh.
So how do you use nohup?
Imagine you use ssh to remotely log in to another computer. You run a very time-consuming command and then exit the ssh session, but the command is still being executed. And nohup can make this scene a reality.
For example, I used my raspberry pie to download the distribution for testing purposes. I would never give my raspberry pie an external monitor, keyboard or mouse.
I usually use SSH to connect to raspberry pie from my laptop. If I use raspberry pie to download large files without nohup, I have to wait until the download is complete before I can log out of the ssh session and turn off my laptop. But if so, why would I use raspberry pie to send down documents?
The method of using nohup is also simple, as in the following example, enter the command to be executed after nohup:
Nohup wget http://mirror.is.co.za/mirrors/linuxmint.com/iso//stable/17.1/linuxmint-17.1-cinnamon-64bit.iso & 5. Run the Linux command at a specific time
The nohup' command is useful when you use SSH to connect to the server and keep performing pre-SSH logout tasks.
Think about what happens if you need to execute the same command at a specific time.
The command 'at'' will solve the situation properly. The following is an example of the use of at'.
At 10:38 PM Friat > cowsay 'hello'at > CTRL + D
The above command runs the program cowsay at 10:38 on Friday afternoon.
The syntax used is to append date and time after 'at'. When the at > prompt appears, you can enter the command you want to run at that time.
CTRL + D returns to the terminal.
There are also many date and time formats that you need to flip through 'at' 's man manual to find more ways to use it.
6. Man manual
The Man manual will outline the use of commands and parameters and teach you how to use them. The Man manual looks dull and dull. I thought they were not designed to entertain us either.
But that doesn't mean you can't do something to make them more beautiful.
Export PAGER=most
You need to install 'most';' she will make your man manual more colorful.
You can set the specified governor for the man manual with the following command:
Export MANWIDTH=80
Finally, if you have an available browser, you can use-H to open any man page in the default browser.
Man-H
Note that the above command only works if you set the default browser to the environment variable $BROWSER.
7. Use htop to view and manage processes
Which command did you use to find out which process is running on the computer? I bet it's' ps' and add different parameters to it to get the different output you want.
Install 'htop'! It's definitely too late for you to meet.
Htop presents processes as lists in the terminal, somewhat similar to the task manager in Windows. You can use a combination of function keys to switch between the arrangement and the items displayed. You can also kill the process directly in htop.
Simply type htop in the terminal and run it.
Htop8. Browse the file system using ranger
If htop is a good helper for command-line process control, then ranger is a good helper for command-line browsing of file systems.
You may need to install it before using it, but once installed, you can start her by typing the following command on the command line:
Ranger
In the command line window, ranger is very similar to some other file managers, but compared to the upper and lower structure layout, it is left and right structure, which means that you press the left arrow key you will move to the previous folder, while the right arrow key will switch to the next one.
Ranger's man manual is worth reading before using it, so you can use keyboard shortcuts to manipulate ranger.
9. Cancel the shutdown
It was only after shutting down the command line or the graphical user interface that I realized that I didn't really want to turn it off.
Shutdown-c
It is important to note that if the shutdown has already begun, it may be too late to stop the shutdown.
Here is another command you can try:
Pkill shutdown
10. A simple way to kill a pending process
Imagine that the application you are running is frozen to death for no reason.
You can use'ps-ef''to find the process and kill or use 'htop'.
There is a faster and easier command called xkill.
Simply enter the following command in the terminal and click on the application you want to kill in the window.
Xkill
What if the whole system goes down?
Hold down 'alt'' and 'sysrq'' on the keyboard, and then slowly enter the following keys:
REISUB
In this way, your computer can restart without pressing the power button.
11. Download Youtube video
Generally speaking, most of us like to watch Youtube videos and stream Youtube through our favorite players.
If you need to be offline for a period of time (for example, during a flight from southern Scotland to southern England), you may want to download some videos to your storage device and watch them in your spare time.
All you have to do is install youtube-dl from the package manager.
You can use youtube-dl with the following command:
Youtube-dl url-to-video
You can click the sharing link on the Youtubu video page to get the url of the video. Simply copy the link and paste it to the command line (use the shift + insert shortcut key).
This is the end of the content of "what Linux Translation Terminal commands". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Change file permissions 2 / etc/hosts* to see if permissions are set
© 2024 shulou.com SLNews company. All rights reserved.