CentOS learning File Attribute command

Source: Internet
Author: User

CentOS learning File Attribute command

I. Common file types in Linux

-: Common file (f)

[Root @ linuxstudy ~] # Ls-l

-Rw ------- 1 root 1017 Dec 8 anaconda-ks.cfg

B: block Device Files (blocks) [devices that are randomly accessed are measured by data blocks (512 bytes, such as hard disk/dev/hda1,/dev/sda2,/dev/fd0]

[Root @ linuxstudy dev] # ls-l

Brw-rw ---- 1 root disk 22, 0 Jan 11 07:01 hdc

D: directory file

[Root @ linuxstudy/] # ls-l

Drwxr-xr-x 2 root 4096 Dec 9 10:20 bin

C: character device file (character) [linear access device, in characters, such as keyboard, mouse, display, printer, terminal, etc]

[Root @ linuxstudy dev] # ls-l

Crw-rw ---- 1 root audio 14, 12 Jan 11 07:01 adsp

P: Pipeline command file (pipe) [from one end to the other. Such as: file image, compression]

[Root @ linuxstudy root] # ls-l wupipe

Prw-r -- 1 root 0 Jan 11 07:05 wupipe

S: socket file (socket) [All files starting with "" are socket files]

L: Symbolic Link [pointing to another file, similar to the shortcut under wind]

[Root @ linuxstudy dev] # ls-l

Lrwxrwxrwx 1 root 3 Jan 11 07:01 cdrom-> hdc

Ii. Linux File List attributes

[Root @ linuxstudy/] # ls-l

Drwxr-xr-x 2 root root4096 Dec 8 07: 57 Desktop ---------->The related attributes of this file are as follows:

File Type

File Permission: 9 bits, each 3 bits, each group: rwx (read, write, execute ),

Number of file hard connections

Owner of the file)

File group)

File size, in bytes

Timestamp: The last modification time.

Note: Each file has three timestamps.

Access: access

Modify: modify (modify file content)

Change: change, metadata (changes in file attributes or metadata)

File Name

Iii. Linux directory

Linux uses the FHS [Filesystem Hierarchy Standard-file system directory Standard] file organization form, and FHS uses a tree structure to organize files; FHS defines the purpose of each region in the system, the files and directories that need the minimum structure, and provides Exception Handling and conflict handling.

/Boot: file related to system startup. Such as kernel, initrd, grub (bootloader)

/Dev: Device File

/Etc: Configuration File

/Home: the home directory of a user. The default home directory of each user is/home/USERNAME.

/Root: Administrator's home directory

/Lib: library file (some encapsulated model functions can be called by multiple files) (the Library file cannot be executed independently because no interface is executed, and it can only be called by other programs)

Databases are divided:

Static Library:

Dynamic library: in linux:. so (shared object sharing object), in windows:. dll

/Lib/modules: kernel module File

/Media: mount point directories are generally mounted to mobile devices, such as USB flash drives and CDs.

/Mnt: generally used for mounting temporary Devices

/Opt: optional Directory, which is generally the installation directory of a third-party program

/Proc: pseudo file system, kernel ing file (stored in memory, real-time information of the storage system)

/Sys: pseudo file system, property ing file related to hardware devices

/Tmp: Temporary File

/Var/tmp

/Var: changeable File

/Bin: executable file, USER command

/Sbin: Management command

/Usr: globally shared read-only files

/Usr/bin

/Usr/sbin

/Usr/lib

Iv. Linux Command Classification

Commands: Internal commands and external commands.

Internal commands: commands provided by shell,

External command: In a system path, there is an executable program with the same name as the command

Type COMMAND determines whether the COMMAND is an internal or external COMMANDExample:

[Root @ localhost ~] #Type cd determines whether the "cd" command is an internal or external command

Command help search

Search for internal commands: helpcommand

[Root @ linuxstudy/] # help cd

External command query: command -- help [most commands can be found in this way]

[Root @ linuxstudy/] # ls -- help

Man SEARCH command usage

ManCOMMAND displays the command user manual. man is generally used to view external commands.

Man manual has chapter concepts

1 USER command

2. System Call

3. Database call

4. Special files (Device Files):/dev/tty1

5 File Format (command Configuration File Syntax)

6 Game Problems

7 Miscellaneous

8 administrator commands (/sbin,/usr/sbin,/usr/local/sbin)

View COMMAND User Manual: man + chapter number + COMMAND

Whatis + command: the unit in which the command is displayed

Man command screen flip operation

Flip back one page: SPACE key

One page forward: key B

One Line Backward: enter

One row forward, K key

Exit: q key

Search keywords

/Keyword: search from the file header to the end

? Keywords: search from the end of the file to the header

N/N key: forward or backward keyword
This article from the "five long way" blog, please be sure to keep this source http://waq1688.blog.51cto.com/2621504/1602272

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.