The five commands + tools that Linux administrators have to know

Source: Internet
Author: User
Tags available for file files linux operations the beginning use

There are a number of very useful tools available for Linux administrators to choose from. Here, I'm just enumerating 5 of the tools that Linux administrators need to use in their day-to-day operations. I think that the most powerful tools may not be appropriate for your use, and there are certain tools I forgot to count them in, and if so, I implore you to write down the tools I didn't include in the comments. In addition, the tools mentioned in this article are only optional, not everyone must need them, and the tools that are not mentioned do not mean that Linux administrators do not need to use tools such as SSH, SCP, and every Linux administrator must use and have no other choice.

#5. Head/tail command

In most cases, the only purpose of logging on to a server is to diagnose some problems, as is the general method of viewing logs. There are a variety of different application types of logs, such as Apache logs, MySQL logs, mail logs and so on. So what commands do you use to check the log, isn't it tail? This is similar to the fact that we can sometimes use the "head" command to view the first few lines of a file.

Several examples:
# * Keep checking Apache error log files, you can use the following command:
#
# tail/var/log/httpd/error_log
#
# * To view the first 15 lines in the MySQL log, you can use the following command:
#
# Head-15/var/log/mysqld.log

#4. Vi/nano/emacs Tools

Generally speaking, text editors need to be used frequently to create/update configuration files. I prefer to use vim, very comfortable to use, easy to remember some of its quick edit commands.

Here are a few examples of using VI. With VI to open a file, and do not enter the Insert mode, you can enter the following useful characters:
# => Jump to end of line
# $
# => Jump to the beginning
# 0
# => Delete the remaining lines
# D
# => repeats previous command
#. Point) The
# => adds "Maal" to the end of each line. 1 represents the first line, the $ represents the last line of
#: 1,s/$/maal/
# => at the beginning of the 5-10 line, plus the "Bingo"
#: 5,10 s/^/bingo/
# => file, if Foo is present in the contents after the cursor, Replace it with Bar
#: s/foo/bar/g
# => Delete the line and go into insert mode
# C
# => Remove ^m
# in Windows system files: Se ff=unix
# => Open/ Turn off the number of lines display
#: Set nu
#: Set Nonu
# => display the actual number of rows in a file
#:%!cat-n
# => Locate the words under the cursor
# * (asterisk)

Related Article

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.