Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the skills of using Linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the skills for the use of Linux", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the skills for using Linux" this article.

1. Fast jump command-z

If you want to go to a folder with a deep directory every time, like this:

# cd / root/py/auto/fabric

Is it annoying to enter many directory names every time? here is a very convenient operation to replace it-z command:

The source code of z is here: https://github.com/rupa/z/blob/master/z.sh

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

# source z.sh

Or

#. .bashrc

To jump to a directory, use the z + directory name directly (this directory must have been entered before).

Z this script assigns a weight to each directory you enter, and then adjusts it to the directory you enter according to the weight.

two。 Configure vim

If you often write shell,python or c under the terminal, most of them should use vim. As a vim party, how can you do without a cool interface for writing code? so, do you want the following interface? Includes code completion, fast search files, directory tree, py and c header file completion and other functions.

Download the vim configuration file and extract it in the user root directory to complete, the method of use, please search, can operate very skillfully depends on your mastery of vim.

3. Set the prompt for mysql

Sometimes you need to connect to multiple servers at the same time and operate different mysql. Because the mysql command line does not have a user or host prompt by default, it is easy to misoperate, so you can add the following configuration in the / etc/my.cnf file to display the mysql prompt:

[mysql] prompt= "\\ u @\\ h:\\ d\\ r:\\ m:\\ s >"

Re-enter the mysql and that's it:

4. View the current system version

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

[root@sta ~] # cat / etc/issue CentOS release 6.8 (Final) Kernel\ r on an\ m [root@sta ~] # cat / etc/redhat-release 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 information of the system, generally empty the files, or such files may be tampered with. Then use the following command, which is probably the most accurate command to view version information:

After the CentOS installation is completed, a centos-release+ version number of the rpm package is installed by default.

5. View the system disk

What should I do if I want to check the disk usage of a system? The fdisk and df commands are probably the most used, but take a look at the following commands:

Is it more intuitive than the results of the fdisk and df commands?

The above is all the content of this article "what are the tips for using Linux?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report