Six practical OS X "terminal" Tips

Source: Internet
Author: User

Six practical OS x Terminal tips the Terminal in OS X system is very useful. It can often be used to implement graphical interfaces (GUI) which cannot be implemented. If you can also learn some tips about it, it will be very useful for your usual terminal operations. Control + u if you find any input error in a terminal command, you can use the control + u shortcut key to directly Delete this entire command, and then you can enter it again. Many people may be familiar with mkdir as a tool for creating folders in "terminal", such as mkdir./abc. You can create a folder named abc in the current directory. But what if I want to create more levels of directories? You need to use the mkdir-p command, for example, mkdir-p./abc/123/guomii/xxx !! Sometimes you write a long command and press enter to find that you do not have the execution permission. You need to add sudo before the command. In this case, you may have to crash. However, sudo can be used !! This command is executed in the same way as sudo {previous command. In addition ,! There is also an amazing use in "terminal"-it can be used to execute your last command starting with a specific letter. For example, you have run multiple commands such as ls, mkdir, find, and chown in a terminal session. Now you can use it! L to execute ls, use! F to execute find... Do you understand it? History uses the history command to display the history of the commands you recently executed. You can also specify the number of display records, such as history 20, to display the history of the last 20 commands. In addition, you can also filter commands that contain specific characters. For example, you can use history | grep mk to display only the commands that contain mk in the history. & You can combine the two commands into one. In fact, we have applied this method many times in previous articles. You can go back and see it. The reset function is very simple-Clear the content on the current "terminal" screen, just like opening the terminal.

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.