Initial knowledge of Linux file management

Source: Internet
Author: User
Tags temporary file storage touch command uppercase letter

Initial knowledge of Linux file management

1. File System and directory structure

The file system starts from the root directory, using "/". Files with a. Start are hidden files, paths are separated by/represented. the hierarchical structure of the file system is LSB (Linux standard base), which follows the file system hierarchy standard (FHS )

File naming rules: Filenames up to 255 bytes, including path names, total 4,095 bytes

Blue –> directory Green –> executable red –> compressed file light blue –> link file Gray –>

Except for slashes and nul, all characters are valid, but special characters are not recommended, and some characters need to be quoted in quotation marks.

Standard Linux file System (EXT4)

File system structure:/Boot: Boot file directory/bin: Provides basic user command/root: Administrator's home directory

/sbin: Administrator-used command/lib: library file/media: Mobile device mount point

/etc: Profile///home directory for normal users/mnt: temporary file system mount point

/dev: Device files and special file storage location/tmp: Temporary file storage location/var: changeable file

/sys: Pseudo file System (Hardware device-related mapping file)/proc: Pseudo file System (kernel mapping file)

/usr: system resources for all users

relative path : Path beginning with "./", default absolute path : Path beginning with "/"

File types under Linux:-: Normal file D: Directory file B: Block device C: Character device P: Piping file Pipe S: Socket file scoket L: Symbolic link

Each shell and system process has a current working directory: #pwd: Displays the current working path

CD command:Switch to parent directory:
CD..
                  to switch to the current user home directory:
                  CD
                  switch to the previous working directory:
                  cd–

ls command: ls-a ls-a ls-r ls-ld ll

Show all files displayed in addition to. and. Files other than the display directory itself displays the long format of the file

Stat: View timestamp stat file

Atime Access Time Mtime Modify time CTime change time

File name wildcard (key): * Match 0 or more characters? Match any single character ~ Current user home Directory

[0-9] Match a number range [Wang] to match any one of the characters in the list: including W,a,n,g

[^wang] matches characters other than all characters in the list

Man 7 Glob [:d igit:] Any number, equivalent to 0-9
[: Lower:] Any lowercase letter [a-z][a-z] Try not to use, display may result in matching not
[: Upper:] Any uppercase letter
[: Alpha:] any case letter
[: Alnum:] Any number or letter [:p UNCT:] Punctuation

Touch command: Create empty files and Refresh time

Touch-a touch-m touch-t

Only change atime and CTime only change mtime and CTime Specify the time of Atime and Mtime ([[CC]YY]MMDDHHMM[.SS])

CP Command:

CP-A archive replication available for backup

The MV command and CP command usage are basically consistent: mv-f force move MV can be used to rename

RM command: RM [OPTION] ... FILE ...-f: Force Delete-R: Recursive

Example: #rm-RF/This operating system is hanging, use with caution! CENTOS7 now provides protection, this command will not be executed immediately

Tree: Show Directory tree

MKDIR-PV: Batch build directory and display-P: exists in no error, and can automatically create the required directories

Initial knowledge of Linux file management

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.