White learning with the mind

Linux system directory

/ Below comprising a bin, boot, dev, etc, home, root, run, sbin, tmp, usr, var directories in

The lower level also hierarchical directory

Directory naming Linux system has its regularity

1. file system hierarchy: LSB Linux Standard Base

2. File names up to 255 characters, including the file name including the path up to 4095 bytes

3. roughly be divided into its file, the name of the color blue - catalog, green - the executable file, red - compressed files, light blue - linked files (soft link), Gray - other files.

4. In addition to the slash and NUL, all the characters are valid, but special characters in directory names and file is not recommended.

The standard Linux file system (e.g. ext4), the file names are case sensitive

/ Boot: the system is started, the required boot file storage directory

/ Bin: to store binary files directory that all users of basic commands, stored in this directory, the system starts, it will start at the same time.

/ Sbin: the same binary file directory, which contains the basic commands management class, the same time the system starts, it will start at the same time.

/ Lib: stock in this directory.

/ Lib64: for inventory on x86_64 systems in this directory.

/ Etc: Configuration Files directory.

/ Root: administrator's home directory.

/ Home / USERNAME: regular user's home directory.

/ Medie: Portable mobile device mount point.

/ Dev: device file directory.

/ Tmp: Temporary files.

/ Var: log, the data is stored can vary.

View metadata file

stat command

File Name File displays file

Size: size of the file

Blocks: block size

Inode: node number

Links: the number of links

Gid: Group ID

Uid: User ID

change time: time change

access time: Access time

modify time: Modified

File type and other information

Modify the file access time, you can touch command.

touch command usage

Format: touch [OPTION] ... FILE ...

-a change only atime and ctime

-m change only the mtime and ctime

-t [[CC]YY]MMDDhhmm[.ss]

Atime and mtime specified timestamp

-c If the file does not exist, will not be created

Difference between soft and hard links link

1. nature: A hard link is a file with a different name (a file name from the multiple). Soft link, the file is different, although to the source file, but not the same file.
2. Cross-Zoning: hard link does not support across partitions, soft links support across partitions.
3. Directory: hard link does not support the creation of directories, soft links support for directory creation.
4. relationship: hard links are mutually independent relationship of equality, nothing to do, just delete the less a name, does not affect other people, just to reduce a number of links. Soft link is a dependency, the original file is deleted, the soft link failure.
5.inode Number: A hard link is the same, soft links are different.
6. The number of links: create a hard link, link number will grow, while the soft link is not growing.
7. Path: The original file path, relative path is the path of relatively soft link soft link, rather than the original file path. A hard link is relative to the current working directory.
8. File type: hard link with the original file types, and soft links for linked files. And the file is not the same color.
9. Command: Command achieved is not the same, the hard links for LN, soft link is -s LN
10. The production: In a production environment, limitations of hard links to the more soft link with fewer limitations.

File Management command on Linux

cd Change the user's current working directory 

cp Copy the source file or directory to the target file or directory

ln files used to create the connection piece

ls display the directory contents list

mv to rename a file or directory

nano text editor character terminal

pwd absolute path displayed the user's current working directory

rm is used to delete files and directories given

tree tree view list the contents of
touch to create a new empty file

rename replaced with a character string Batch change the file name

Stat files for displaying status information

ls 

Lists the contents of the current directory or the specified directory
Usage: ls [options] [files_or_dirs]  exemplary
ls -a contain hidden files
ls -l display additional information
ls -R recursive directory
ls -ld directories, and symbolic link information
ls -1 file branch display
ls -S Sort by descending
ls -t Sort by mtime
ls -u with the -t option to display and press atime new to old Sort
ls -U directory stored in the order shown by
ls -X sort by file extension

 

 

Guess you like

Origin www.cnblogs.com/Linjiuy/p/11802552.html