11 Cool Linux Terminal commands Daquan

Source: Internet
Author: User

Guide Today to share with you 10 years of Linux summed up 11 cool Linux terminal commands, through today's article I will show you a series of Linux commands, tools and techniques, I hope to help everyone.

1. Command line daily shortcut keys

The following shortcuts are very useful and can greatly improve your productivity:

CTRL + U         cut the contents of the cursor before the CTRL + K         cut 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 ALT + F         jump down a space alt + B         jumps back on a space Alt + Backspace Delete previous Word Ctrl + W        cut cursor after a word shift + Insert  paste text inside the terminal

So in order to make the above content easier to understand, look at the following line of commands.

sudo apt-get intall programname

As you can see, there is a spelling error in the command, and the "intall" should be replaced with "install" for normal execution.

Imagine now that the cursor is at the end of the line, we have many ways to return her to the word install and replace it.

I can press two times alt+b so the cursor will be in the following position (where the cursor is used to refer to).

sudo apt-get install ProgramName
Now you can double-click the arrow keys and insert "s" into the install. If you want to copy the text from the browser to the terminal, you can use the shortcut "SHIFT + Insert".
2. SUDO!

sudo this command permission delegation, in the environment of their own usual practice may encounter less, but in the enterprise environment often encountered this command. Because if you don't know, it will be painful every time you see "Permission denied" after you enter a long list of commands. How to use sudo!!? Very simple. Imagine you just entered the following command:

Apt-get Install Ranger

"Permission denied" will appear unless you are already logged in to an account that is high enough to be privileged.

Sudo!! will run the previous command in the form of sudo. So the last command becomes this:

sudo apt-get install Ranger

3. Pausing and running commands in the background

CTRL + Z \ \ Pause Application

FG \ \ Re-calls the program to the foreground

Usage examples:

Let's say you're halfway through using sudo nano abc.txt, you realize that you need to enter some commands at the terminal right away, but the nano runs in the foreground so you can't enter it. You might think that the only way to do this is to save the file, exit the Nano, and then reopen the nano after running the command.

In fact you just press CTRL + Z, the front desk command will be paused, the screen will be cut back to the command line. Then you can run the command you want to run, and when the command finishes, enter "FG" in the terminal window to return to the previously paused task.

4. Use Nohup to still run commands after logging out of an SSH session

The nohup command is really useful if you are using SSH to log on to other machines. So how do you use Nohup?

For example, because of the need for testing, I sent a raspberry to download the release version. Generally I always use SSH to connect to the Raspberry Pi from my laptop computer. If I use Raspberry Pi to download large files without nohup, I have to wait until the download is complete before I log out of my SSH session and turn off my notebook. But if so, why should I use the Raspberry Pi file?

The method of using Nohup is also very simple, just enter the command you want to execute after nohup in the following example:

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 are using SSH to connect to the server and keep the SSH logout task on top of it.
Think about what to do if you need to execute the same command at a specific time?
Command ' at ' to properly resolve the situation. The following are examples of ' at ' use.

#at 10:38 PM friatat>cowsay ' Hello ' at> CTRL + D

The above command can run the program Cowsay on Friday 10:38 P.M..

The syntax used is the append date 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 many date and time formats that require you to turn over the ' at ' manual to find more ways to use it.

6. Man Handbook

The Man handbook will give you an outline of the commands and parameters used to teach you how to use them. The man handbook looks dull and stiff. But that doesn't mean you can't do anything to make them look beautiful:
Export Pager=most you need to install ' most '; she will make Your Man handbook more colorful.
You can use the following command to set the specified president for the man Manual:
Export MANWIDTH=80 Finally, if you have a browser available, you can use-H to open any of the man pages 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. Viewing and managing processes using Htop

Which command do you use to find out which processes are running on your computer? I bet it's ' ps ' and then add a different parameter to get the different output you want.

Install ' htop '! Absolutely let you brief encounter.

Htop renders the process as a list in the terminal, somewhat similar to Task Manager in Windows. You can use the combination of function keys to toggle the way you arrange and the items that are displayed. You can also kill the process directly in the htop.

Simple input htop in the terminal can be run.

8. Browse the file system using Ranger

If Htop is a good helper for command-line Process Control, then Ranger is a good helper for the command line to browse the file system.

You may need to install it before you use it, but once you install it, you can start her by typing the following command at the command line:

Ranger in the command-line window, ranger and some other file managers, but compared to the upper and lower structure layout, she is the left and right structure, which means that you press the LEFT ARROW key you will advance to the previous folder, and the arrow keys will switch to the next.

The Man manual Ranger before use is still worth reading, so you can use the shortcut key to operate the ranger.

9. Cancel Shutdown

Whether the command line or graphical user interface is turned off, only to find that you do not really want to shut down the computer.

Shutdown-c, Pkill shutdown

10. Simple way to kill the suspend process-xkill

When you find an unknown cause of the running application zombie. You can use ' ps-ef ' to find the process and then kill it or use the ' htop ' command.

There is a quicker, 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 kills the process, what if the system is stuck? Simple command:

Press and hold the ' Alt ' and ' SYSRQ ' on the keyboard, then slowly enter the following keys:
You can restart your computer without pressing the power button.

11. Download YouTube Video

In general, most of us like to watch YouTube videos and also play YouTube streaming through our favorite player. Share the offline watch YouTube video below, where you need to install YOUTUBE-DL.
You can get the URL of the video by clicking on the Share link on the Youtubu video page. As long as the simple copy link is pasted to the command line OK ...

YOUTUBE-DL Url-to-video

11 Cool Linux Terminal commands Daquan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.