Linux you do not know the use of skills summary _unix Linux

Source: Internet
Author: User

One, quick jump command one Z

If you want to go into a folder that is very deep in a directory every time, like the following:

# Cd/root/py/auto/fabric

Each time you have to enter a number of directory names is not very annoying, there is a very convenient operation can replace it a Z command:

You only need to copy the source code to the user directory z.sh file, and then at the .bashrc end of this file add " source /path/to/z.sh ", and finally use:

# source Z.sh

Or

# . . BASHRC

To jump to a directory, use the z + directory name directly (this directory must be previously entered).

Z This script assigns a weight to the directory you enter each time, and then it is transferred to the directory you entered according to the weight.


Second, configure Vim

If you often write Shell,python or C in the terminal, most should use vim it, as a vim party, there is no cool code to write the interface how to do it, so, you want the following interface? Contains code completion, fast search file, directory tree, py and C header file complement the Congruent function.


Download the vim configuration file and unzip it in the user root directory can be completed, use the method please search, can not operate very skilled also depends on your grasp of the vim situation.

Third, set up a prompt for MySQL

Sometimes you need to connect to multiple servers at the same time, and operate different MySQL, because the MySQL command line defaults to no user or host prompts, so easy to operate incorrectly, so you can /etc/my.cnf add the following configuration in the file to display the MySQL prompt:

[MySQL]
Prompt= "\\u@\\h: \\d \\r:\\m:\\s>"

Re-access to MySQL is the case:


MySQL prompt

Iv. View the current system version

You may often use the following methods to view the version of the system:

[Root@sta ~]# cat/etc/issue
CentOS Release 6.8 (Final)
Kernel \ R on a \m

[Root@sta ~]# Cat/etc/redhat-re Lease 
CentOS Release 6.8 (final)

[Root@sta ~]# cat/etc/issue.net CentOS release 
6.8 (final)
Kernel \ r on an \m

However, these files may expose the system's information, typically emptying the files or possibly tampering with such files. It's going to use the following command, which is probably the most accurate command for viewing version information:


View current system version

View current system version

A centos-release+ version number RPM package is installed by default when the CentOS installation is complete.

V. View system disks

What if you want to see the amount of disk usage for a system? The most used should be the fdisk and df command bar, but look at the following command:


viewing system disks

is fdisk df more intuitive than the results of the command.

Summarize

The above is the entire content of this article, I hope that the study or work to bring some help, if you have better skills, but also want to share with you, thank you for the cloud-Habitat community support.

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.