Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

System directory naming rules and uses for Linux distributions

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Linux file system names are case sensitive

With. The beginning of the file is hidden.

/ boot: boot file storage directory, kernel files, boot loader all exist in this directory

/ bin: basic commands used by all users, which cannot be associated with a separate partition, and will be used when OS starts.

/ sbin: the basic command of the management class, which cannot be associated with a separate partition. The program will be used when OS starts.

/ lib: basic shared library files and kernel module files that the program depends on at startup

/ lib64: dedicated location for auxiliary shared library files on x86-64 systems

/ etc: configuration file directory

/ home/username: home directory for ordinary users

/ root: administrator's home directory

/ media: portable mobile device mount point

/ mnt: temporary file system mount point

/ dev: storage location for device files and special files

/ opt: third-party application installation location

/ srv: data used by services running on the system

/ tmp: temporary file storage location

/ usr: universal shared read-only data

Bin: an application that ensures the full functionality of the system

Header file (header file) of the include:C program

Share: structured independent data, such as doc;man, etc.

Local: where third-party applications are installed

Bin;sbin;lib;lib64;etc;share

/ var: variable data file (variable)

Cache: application cache data directory

Lib: application state information data

Locao: designed for applications under / usr/local to store variable data

Lock: locking files

Log: log directories and files

Opt: dedicated to storing variable data for applications under / opt

Run: running process-related data, usually used to store process pid files

Spool: application data pool

Tmp: save the temporary data generated between system restarts

/ proc: used to output the virtual file system related to the kernel process information

/ sys: virtual file system used to output information about hardware devices on the current system

/ seLinux:seLinux-related security policies and other information storage location

What is the file metadata, how to view it, how to modify the timestamp

You usually use the stat command to view file metadata

File name (file): the name of the file

File size (size): file size

Number of blocks (blocks): the number of blocks occupied by the file

Block size (IO Block): size of each block

File type (regular file): indicates what type of file it is

Inode number: what is the inode number?

Number of hard links (links): how many times have they been hardlinked

Permissions (access): specific permissions

Owner (uid): owner ID

Generic group (Gid): generic group ID

Access time (access): the most recent visit time

Modification time (modify): the most recent modification time

Metadata modification time (change): metadata change time

Change the timestamp: touch [option] file

-a: modify only atime and ctime

-m: modify only mtime and ctime

-t: you can specify to modify atime and mtime

-c: no new files will be created

Summarize the difference between soft links and hard links

1, the essence is different: hard links are multiple names of the same file, file inode number is the same, deleting a file will not affect other files with the same inode number; soft link is a symbolic link pointing to another file, the deletion of the soft link will not affect the original file, and the deletion of the original file will invalidate the soft link.

2. hard links will increase the number of links when creating links. Soft links will not.

3. The inode number of hard links is the same, but the soft links are different.

4. Hard links can only be carried out on the same file system, and cannot be used on directories. Soft links can be carried out across partitions and directories.

5. When creating a soft link, the relative path of filename is relative to linkname, and linkname is the absolute path.

File management commands on Linux and how to copy files and directories cp

Cp [option] SRC DEST

-I: prompt before overwriting

-n: do not overwrite existing files (rewrite)

-rmaine Murr: recursively copy the directory and all its internal contents

-d: do not copy the original file, only the link name

-- preserv [= list]

Mode: permission

Ownership: owner

Timestamp: timestamp

-p: equivalent to all of the above list

-v: displays the replication process

-f: force copy, delete existing files, rewrite

-a: archive, full copy

-u:--update: only copy files where the source is newer than the destination or if the destination does not exist

-b: if the target exists, back up before overwriting, in the form of filename~

-- backup=numbered: if the target exists, backup and numeric suffix deletion command rm before overwriting

Rm [option] file

-I: default; interactive

-f: force deletion

-r: recursive

When deleting a file using rm, if other programs are occupying the file, the disk occupied by the file will not be released immediately, so overwriting the file with the ">" sign and then deleting it with rm can immediately free disk space to display the directory tree tree.

Tree[option] file

-d: show only directories

-L:level: displays the specified number of levels

-p:pattern, showing only the path to which the specified pattern matches the creation directory mkdir

Mkdir[option] dirname

-p: automatically create the required directories

-v: shows the creation process

-m:mode, specify permission to modify the file name in batch when creating: rename [option] A B C

Change An in C file to BMageC can be multiple files, denoted by *, "" empty "

6. Move a file or directory mv copy / etc/profile to the / tmp directory and delete the white space character at the beginning of the line in the / tmp/profile file with the find replace command

Copy first with the CP command

Then enter VIM to check and correct.

Use the command cat / data/profile | tr-d "" > / data/profile1

Set VIMTab to indent 4 characters

Set tabstop=4

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report