Linux commands lsattr, chattr, man

Source: Internet
Author: User
Tags documentation

1, man command, you can view the manual

Configuration Location/etc/man.conf

Manpath Decision Manual Query location

Mansect determining the Order of man queries

Man's query

Common uses of Linux man:
man section cmd: direct Specify a specific chapter within the Search man page, such as Span style= "Color:blue" >man 5 passwd directly into file format version of Help
man-a cmd : Open help with the same name in all sections, for example Man–a passwd, you first enter a passwd (1) command version passwd Help, and you press the Q key to enter passwd (5), passwd configuration file Format help
man-aw cmd: Show path of all manuals files for all cmd, such as Man-aw passwd is
/usr/share/man/man1/passwd.1.gz
/usr/share/man/man5/passwd.5.gz
Specifies the search path of the manual file, such as Man-m/home/mysql/man MySQL display is the help of your installed MySQL, not the system comes with the old version of MySQL Help
man cmd| col-b > Cmd.txt: Output man manual information to a text file

man Brief introduction:
The man in Linux is very powerful, and the manual is divided into sections, which can be used to specify a different section to navigate by using the man, each of which has the following meanings:

    • 1–user Commands General user commands
    • 2-system Calls System invoke commands, such as open,write (through this, at least it is convenient to find the call this function, which need to add a header file)
    • 3-c Library Functions C function Gallery commands, such as Printf,fread
    • 4-devices and special files is a special file, which is the various device files under/dev man HD
    • 5-file formats and conventions refers to the format of a file, such as the Man 5 passwd, which shows the meaning of each field in this file/etc/passwd
    • 6-games for Linux is reserved for games and is defined by each game itself
    • 7-miscellanea Miscellaneous, such as macro command packages, conventions, and so on.
    • 8-system Administration Tools and Deamons are commands for system administration that can only be used by root, such as Ifconfig
    • 9-Other (Linux-specific) for storing the kernel The documentation for the routine program.
    • N New documents that may be moved to a more appropriate area.
    • o old documents may be retained for a period of time. The
    • l local document, which is related to this particular system.


Man command format:
Man [option] name:name is usually the name of the Help document, corresponding to the command name, function name, or configuration file name (with suffix!). ), such as
Man nsswitch.conf: View the Help documentation for the/etc/nsswitch.conf file
Man networks: View the Help documentation for the/etc/sysconfig/networks file

To view the Help documentation for a specific language version: set the environment variable LANG=ZH_CN before executing the man query

Man's configuration file/etc/man.config:
If you don't want to specify the path with-M every time man cmd, you can modify the configuration file to add content such as
Manpath/home/mysql/man

Man 's search order in each section can be modified in the following way, but it is generally not recommended.
Mansect 1:8:2:3:4:5:6:7:9:tcl:n:l:p:o

2, Lsattr

Show hidden properties of a file

Chattr to modify hidden properties of a file

CHATRR +a Tmp.txt so that files can only be added, cannot be modified, can not be deleted, suitable for various log files

Chattr +i tmp.txt to make the file unable to be deleted


a:即append,设定该参数后,只能向文件中添加数据,而不能删除,多用于服务器日志文件安全,只有root才能设定这个属性。
i:设定文件不能被删除、改名、设定链接关系,同时不能写入或新增内容。i参数对于文件 系统的安全设置有很大帮助。

Reference:

1, http://www.runoob.com/linux/linux-comm-lsattr.html

Linux commands lsattr, chattr, man

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.