Ubuntu commands (Continuous updates ......)

Source: Internet
Author: User
Tags disk usage

(1)In a large folder, I want to find a file containing a certain string, for example, find the file where the function fastatan2 is located in the opencv folder.

Find and grep. The find command is used to find a specific file (directory) in the current folder ),

(2)Write the alias command alias to the system configuration file to prevent the variables defined by yourself from being invalid after Bash is deregistered.

The configuration file you prefer to write is in your home directory. in the bashrc file, the first character of the file name is a vertex. Therefore, this file is a hidden file and must be LS-A for display. However, this does not affect the modification of this file. The Vim. bashrc command will open the configuration file in Vim, Shift + g (that is, g) to move the cursor to the last line of the file, and then add the command alias CLS = 'clear '. Exit vim. Then run source./bashrc on the terminal. In this way, the CLS command will take effect after a bash is opened.

(4)How to display and edit hidden files: This is not a big problem, because the hidden file is not as bad as a common file, but the first character of the file name is '.'. Therefore, to use Cat to show hidden files, you do not need to add any specific parameters. Simply use Cat. bashrc (assuming the file opened is. bashsrc ).

(5)Cancel bash waiting for Firefox

Start Firefox by bash, but wait until Firefox exits to accept other command input. It is inconvenient to open so many bash commands. Solution: EnterFirefox &You can.

(6)Modify Command Prompt

If the computer name is too long, the bash default command prompt will be very long and looks uncomfortable. The solution is to modify the environment variable PS1 value, such as setting PS1 = 'honpey @ lab: \ W: $ '. You can write this sentence to the. bashrc file in the main folder so that the command prompt you set will be changed every time you start the system.

(7)View the disk usage of a file

Du (show disk usage) to view disk usage. The-H parameter is used to display the human-readable format. The output result of DU is usually very long, you can add the-S parameter to omit the sub-directories in the specified directory and only display the total directory. For example, Du-SH/Hello

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.