struct stat { dev_t st_dev; /* device*/ ino_t st_ino; /* node*/ mode_t st_mode; /* mode*/ nlink_t st_nlink; /* hard link*/ uid_t st_uid; /* user ID */ gid_t st_gid; /* Group ID */ dev_t st_rdev; /* Device type */ off_t st_off; /* Number of bytes in the file*/ unsigned long st_blksize; /* Block size*/ unsigned long st_blocks; /* Number of blocks*/ time_t st_atime; /* Last access time*/ time_t st_mtime; /* Last modification time*/ time_t st_ctime; /* Last change time (referring to attributes) */};
Let’s learn about these attributes one by one. If you need to view the attributes of a certain file, use
statJust issue the command and it will list the information according to the above structure. in addition,
lsThe command can also display the relevant attributes of the file after following certain parameters, such as
-lparameter.
File types correspond to the above
st_modeThere are many file types, such as regular files, symbolic links (hard links, soft links), pipe files, device files (symbolic devices, block devices), socket files, etc. Different file types correspond to different functions and roles.
$ ls -ltotal 12drwxr-xr-x 2 root root 4096 2007-12-07 20:08 directory_fileprw-r--r-- 1 root root 0 2007-12-07 20:18 fifo_pipebrw-r--r-- 1 root root 3, 1 2007-12-07 21:44 hda1_block_dev_filecrw-r--r-- 1 root root 1, 3 2007-12-07 21:43 null_char_dev_file-rw-r--r-- 2 root root 506 2007-12-07 21:55 regular_file-rw -r--r-- 2 root root 506 2007-12-07 21:55 regular_file_hard_linklrwxrwxrwx 1 root root 12 2007-12-07 20:15 regular_file_soft_link -> regular_file$ stat directory_file/ File: `directory_file/' Size: 4096 Blocks: 8 IO Block: 4096 directoryDevice: 301h/769d Inode: 521521 Links: 2Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)Access: 2007-12-07 20:08:18.000000000 +0800Modify: 2007- 12-07 20:08:18.000000000 +0800Change: 2007-12-07 20:08:18.000000000 +0800$ stat null_char_dev_file File: `null_char_dev_file' Size: 0 Blocks: 0 IO Block: 4096 character special fileDevice: 301h/769d Inode: 521240 Links: 1 Device type: 1,3Access: (0644/crw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)Access: 2007-12-07 21 :43:38.000000000 +0800Modify: 2007-12-07 21:43:38.000000000 +0800Change: 2007-12-07 21:43:38.000000000 +0800
Description: Passed
lsYou can see that the first characters of each line of the command results are different from each other, which just reflects the types of different files.
dRepresents a directory,
-Represents an ordinary file (or hard link),
lRepresents a symbolic link,
pRepresents a pipeline file,
band
cRepresents block devices and character devices respectively (in addition
sexpress
socketdocument). exist
statIn the result of the command, you can find the description at the end of the second line. As can be seen from the above operation,
directory_fileis the directory,
statUsed in the results of commands
directoryrepresents, and
null_char_dev_fileIt uses
character special fileillustrate.
Usually only directories, ordinary files, and symbolic links are used, and other types of files are rarely encountered. However, these files still have their own uses. If you are doing embedded development or process communication, etc., device files, Named pipe (FIFO). The following is a simple operation to reflect the difference between them (the specific principles will be introduced in the next section "Shell Programming Paradigm File System". If you are interested, you can also go online in advance to find the role of device files, block devices and character devices. differences, and how to write related device drivers in the driver, etc.).
For ordinary files: it is a collection of characters, so it can be read, written, etc.
$ echo hello, world > regular_file$ cat regular_filehello, world
New files can be created in the directory, so the directory is also called: folder. The structure of the directory file will be analyzed later. It actually stores the file names of each file under it.
$ cd directory_file$ touch file1 file2 file3
For named pipes, the operation is more interesting: if you want to read it, it will block unless there is content; if you want to write to it, it will block unless someone comes to read it. It is commonly used in process communication. Two terminals can be opened
terminal1and
terminal2, try it:
terminal1$ cat fifo_pipe #It blocks here at first, and does not print the test string until the following writing action occurs terminal2$ echo test > fifo_pipe
Regarding block devices, character devices, device files correspond to
/dev/hda1and
/dev/null, if you have used a USB flash drive or written a simple script, you should have used this method before: :-)
$ mount hda1_block_dev_file /mnt #Mount the first partition of the hard disk to /mnt (the principle of mounting will be discussed in the next section) $ echo fewfewfef > /dev/null #/dev/null is like a black hole, something is missing Once inside, everything disappears
The last two files are
regular_fileHard links and soft links of files, if you read and write them, their contents are the same, but if you delete them, they have nothing to do with each other. What is the difference between hard links and soft links? The former can be said to be the original file, while the latter just has such a
inode, but there is no actual storage space, it is recommended to use
statcommand to see the differences between them, including their
Blocks,
inodeEquivalent, you can also consider using
diffCompare their sizes.
$ ls regular_file*ls regular_file* -l-rw-r--r-- 2 root root 204800 2007-12-07 22:30 regular_file-rw-r--r-- 2 root root 204800 2007-12-07 22 :30 regular_file_hard_linklrwxrwxrwx 1 root root 12 2007-12-07 20:15 regular_file_soft_link -> regular_file$ rm regular_file # Delete the original file $ cat regular_file_hard_link # The hard link is still there, and there is still content in it fefe$ cat regular_file_soft_linkcat: regular_file_soft_link: No such file or directory
Although the soft link file itself is still there, it cannot read anything because it does not store the content itself. This is the difference between soft links and hard links.
It should be noted that hard links cannot cross file systems, but soft links can. In addition, it is not allowed to create hard links to directories.
File types are divided into the above types from the Linux file system level, but ordinary files can still be divided (according to the "data structure" of the file content), such as common text files, executable
ELFdocument,
odtdocument,
jpgpicture format,
swappartition file,
ELFIf you are interested in the working principle of the file, it is recommended to read the references and
ELFThe relevant part of the file, this part is crucial for embedded Linux engineers.
Although various types of ordinary files have their own operating tools, you can still read and write them directly. I will mention these tools first and discuss the details later.
od: "Export" file contents in octal or other formats.
strings: Read the characters in the file (printable characters)
gcc,
gdb,
readelf,objdump
wait:ELF
File analysis and processing tools (gcc
compiler,gdb
debugger,readelf
Analyze ELF files,objdump` decompilation tool)
Add another very important command,
file, this command is used to view the properties of various types of files. and
statCompared with the command, it can further identify ordinary files, namely
statcommand displayed
regular file. because
regular fileThere can be a variety of different structures and thus be interpreted differently and perform different actions with the support of the operating system. Although, under Linux, specific suffixes are added to files so that users can easily identify the file type, the Linux operating system identifies various types of files based on the file header, not the file suffix, which makes it even more difficult to interpret the corresponding files. Error prone. The following is a brief introduction
fileUsage of the command.
$ file ././: directory$ file /etc/profile/etc/profile: ASCII English text$ file /lib/libc-2.5.so/lib/libc-2.5.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped$ file /bin/test/bin/test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped$ file /dev/hda/dev/hda: block special (3/0)$ file /dev/console/dev/console: character special (5/1) $ cp /etc/profile .$ tar zcf profile.tar.gz profile$ file profile.tar.gzprofile.tar.gz: gzip compressed data, from Unix, last modified: Tue Jan 4 18:53:53 2000$ mkfifo fifo_test$ file fifo_testfifo_test: fifo (named pipe)
See more usage
fileCommand manual, about
fileFor the implementation principle of the command, please refer to
magicmanual (look at
/etc/file/magicFile, understand what a file is
magic numberwait).
As a multi-user system, Linux provides great convenience for multiple users to use the same system. For example, for files on the system, it distinguishes different users through their owners in order to allocate their operating permissions to different files. For easier management, the file owner includes the user to whom the file belongs and the user group to which the file belongs, because a user can belong to multiple groups. First, let’s briefly introduce the management of users and groups under Linux.
Linux provides a set of commands for managing users and groups, such as for creating users
useraddand
groupadd, used to delete users
userdeland
groupdel,in addition,
passwdThe command is used to change the user password. Of course, Linux also provides two corresponding configurations, namely
/etc/passwdand
/etc/group, in addition, some systems also put the password separately in the configuration file
/etc/shadowmiddle. Please refer to the following information for their detailed usage. They will not be introduced here. Only some relationships between files and users will be introduced.
$ chown username:group name filename
If you want to recursively modify the owners of all files in a directory, you can add
-Roptions.
From the file structure listed at the beginning of this section, we can see that there are only user
IDand group
IDinformation, but
ls -lThe result shows the user name and group name information. How is this achieved? Let’s take a look first
-nThe result of:
$ ls -n regular_file-rw-r--r-- 1 0 0 115 2007-12-07 23:45 regular_file$ ls -l regular_file-rw-r--r-- 1 root root 115 2007-12-07 23:45 regular_file
As you can see,
ls -nUsers shown
IDand group
ID,and
ls -lTheir names are shown. Remember the two configuration files mentioned above
/etc/passwdand
/etc/groupFile? They store users respectively
IDand username, group
IDcorresponding relationship with the group name, so it is easy to think of
ls -lHow the command passes through the file structure when implemented
IDInformation finds their corresponding name information. If you want to be right
ls -lFor a better understanding of the implementation of the command, you can use
straceTrace to see if it reads both configuration files.
$ strace -f -o strace.log ls -l regular_file$ cat strace.log | egrep passwd|group|shadow2989 open(/etc/passwd, O_RDONLY) = 32989 open(/etc/group, O_RDONLY) = 3
illustrate:
straceCan be used to trace system calls and signals. as
gdbLike other powerful tools, it is based on system
ptraceSystem call implementation.
In fact, it is not good to introduce the owner and permissions separately, because only the combination of the two makes a multi-user system possible, otherwise it is impossible to isolate the operations of different users on a certain file, so the file operation permissions are introduced below.
from
ls -lIn the last 9 characters of the first column of the command result, you can see information similar to this
rwxr-xr-x, which correspond to the file structure
st_modepart(
st_modeContains two parts: file type information and file permission information). This type of information can be divided into three parts, namely
wx,
rx,
rx, respectively corresponding to the operating permissions of the user, group and other groups on the file to which the file belongs. If there is
wxAny one of them means readable, writable, and executable, if
-Indicates that there is no such permission. Correspondingly, it can be represented in octal, such as
rwxr-xr-xIt can be expressed as binary 111101101, and the corresponding octal is 755. Because of this, there are many ways to modify the operation permissions of files, and they can all be done through
chmodcommand to modify.
For example, put
regular_fileModify the file permissions to be readable, writable, and executable by all users, that is,
rwxrwxrwx, can also be expressed as 111111111, translated into octal, it is 777. This permission can be modified in two ways.
$ chmod a+rwx regular_file
or
$ chmod 777 regular_file
illustrate:
aRefers to the user used. If you only want to give the user read, write, and executable permissions, then you can
aReplace with
u;and
+Just add permissions. On the contrary, if you want to remove a certain permission, use
-,and
wxIt corresponds to readable, writable, and executable. See more usage
chmodCommand help.
In fact, in addition to these permissions, there are two other permissions related to security, namely
setuid/setgidand read-only control, etc.
If a file (program or command) is set
setuid/setgidpermissions, then the user will be able to
rootTherefore, this may bring security risks; if the read-only permissions of the file are set, the user will only have readable permissions for the file, which avoids such situations as
rm -rfThe "abominable" operation brings certain blessings.
By default, the system does not allow ordinary users to execute
passwdcommand, pass
setuid/setgid, ordinary users can be authorized to execute it.
$ ls -l /usr/bin/passwd-rwx--x--x 1 root root 36092 2007-06-19 14:59 /usr/bin/passwd$ su #Switch to the root user and add " Sticky bit" $ chmod +s /usr/bin/passwd$ ls -l /usr/bin/passwd-rws--s--x 1 root root 36092 2007-06-19 14:59 /usr/bin/passwd$ exit$ passwd #Ordinary users can modify their passwords by executing this command.
illustrate:
setuidandsetgidBit allows ordinary users torootThe user's role runs onlyrootA program or command that can only be run by an account.
Although this provides convenience for management to a certain extent, for example, the above operation allows ordinary users to modify their accounts instead of
rootAccount to do this work for each user. about
setuid/setgidFor more detailed explanation, please refer to the last recommended information.
Example of read-only permission: lock important files (add immutable bit [immutable])) to avoid catastrophic consequences caused by various misoperations (such as
:``rm -rf)
$ chattr +i regular_file$ lsattr regular_file----i-------- regular_file$ rm regular_file #After adding the immutable bit, you cannot perform any "destructive" activities on the file. rm: remove write-protected regular file `regular_file'? yrm: cannot remove `regular_file': Operation not permitted$ chattr -i regular_file #If you want to perform regular operations on it, you can remove this bit$ rm regular_file
illustrate:
chattrCan be used to set special permissions on files. For more usage, please refer to
chattrhelp.
For ordinary files, the file size is the size of the file content. As a special file, the directory stores various file information organized in a directory structure. Therefore, the size of the directory is generally fixed. It stores The number of files naturally has an upper limit, that is, its size divided by the length of the file name. The "file size" of the device file corresponds to the major and minor device numbers of the device, and the size of the famous pipe file is always 0 due to its special read and write properties. A hard link (directory files cannot create hard links) is essentially a complete copy of the original file, so its size is the size of the original file. A soft link is just a
inode, stores a pointer to the original file, so its size is only the number of bytes of the original file name. Next we increase memory through demonstration.
Examples of file sizes for original files and linked files:
$ echo -n abcde > regular_file #Write 5 bytes to regular_file $ ls -l regular_file*-rw-r--r-- 2 root root 5 2007-12-08 15:28 regular_file-rw-r--r -- 2 root root 5 2007-12-08 15:28 regular_file_hard_filerwxrwxrwx 1 root root 12 2007-12-07 20:15 regular_file_soft_link -> regular_filerwxrwxrwx 1 root root 22 2007-12-08 15:21 regular_file_soft_link_link -> regular_file_soft_link$ i=regular_file$ j=regular_file_soft_link$ echo ${#i} ${# j} #Soft links store exactly the number of bytes of the file name of the original file they point to 12 22
File size corresponding to device number: major and minor device number
$ ls -l hda1_block_dev_filebrw-r--r-- 1 root root 3, 1 2007-12-07 21:44 hda1_block_dev_file$ ls -l null_char_dev_filecrw-r--r-- 1 root root 1, 3 2007-12-07 21:43 null_char_dev_file
Supplement: main
(major), timesThe (minor) device number has different functions. When a device file is opened, the kernel determines the major device number (
major number) to find the driver that has been registered with the major device number in the kernel (you can
cat /proc/devicesCheck the correspondence between the registered driver number and the major device number), and the minor device number (
minor number) is passed to the driver itself through the kernel (refer to Chapter 10 of "The Linux Primer"). Therefore, for the kernel, the corresponding driver can be found to identify a device through the major device number, and for the driver, in order to be able to access the device more complexly, such as accessing different parts of the device (such as hardware divided into different parts through partitions) part, appear
hda1,
hda2,
hda3etc.), such as generating random numbers with different requirements (such as
/dev/randomand
/dev/urandomwait).
The size of the directory file, why is it like this? Look at the size of the directory structure below. The Block of the directory file stores the entries for all file names in the directory.
$ ls -ld directory_file/drwxr-xr-x 2 root root 4096 2007-12-07 23:14 directory_file/
The structure of the directory is as follows:
struct dirent { long d_ino; off_t d_off; unsigned short d_reclen; char d_name[NAME_MAX+1]; /* file name*/}
The time attribute of a file can record the user's operation information on the file, and will provide a reference for the administrator in system management, determining file version information, etc. Therefore, when reading documents, it is recommended to use
catWait for reading tools, don’t use editing tools
vimGo read, because even if no modification operations are made, once the save command is executed, the timestamp information of the file will be modified.
The file name is not stored in the file structure, but in the directory structure in which it is located. Therefore, file names must be unique within the same level of the directory.
For files, common operations include creation, deletion, modification, reading, writing, etc. The "behind-the-scenes actions" corresponding to various operations will be analyzed in detail in the next chapter "Shell Programming Paradigm File System Operations".
socketFile is a special type of file that can be created through C language. It will not be introduced here (it is not known whether it can be created directly with commands). Other files will be created through commands.
$ touch regular_file #Create a normal file $ mkdir directory_file #Create a directory file, which can contain more files $ ln regular_file regular_file_hard_link #Hard link, a complete copy of the original file $ ln -s regular_file regular_file_soft_link #Similar to a file pointer , pointing to the original file $ mkfifo fifo_pipe # or created through mknod fifo_pipe p, FIFO meets the first-in-first-out characteristics $ mknod hda1_block_dev_file b 3 1 #Block device $ mknod null_char_dev_file c 1 3 #Character device
Creating a file actually adds a node to the file system (
inode), the node information will be saved to the node table of the file system. To put it more vividly, it means that a new leaf (file) or branch (directory file, the kind with leaves growing on it) grows on a tree. These can betree
command orThe ls` command is presented visually. From the perspective of daily use, the file system can be viewed as an inverted tree, because they are so similar and easy to remember.
$ tree current directory
or
$ ls current directory
The most direct impression of deleting a file is that the file no longer exists. This can also be achieved by
lsor
treeThe command is presented like a branch being cut off a tree or a leaf being plucked. In fact, after deletion, these files do not disappear immediately, but are only marked for deletion. Therefore, if there are no relevant disk write operations to "cover" the corresponding disk space after deletion, they can be recovered in principle. (Although, such work is often troublesome, so please think twice before deleting some important data, such as doing a backup job). For the corresponding method, please refer to the subsequent information.
The specific commands to delete files are
rm, if you want to delete empty directories, you can use
rmdirOrder. For example:
$ rm regular_file$ rmdir directory_file$ rm -r directory_file_not_empty
rmThere are two very important parameters, one is
-f, this command is very "barbaric" and it probably brings pain to many Linux users. Another one is
-i, this command is very "gentle", and it probably makes many users feel irritated. Which one you use depends on your "mood". If you have done adequate backup work or taken some effective actions to avoid catastrophic consequences, you can feel more at ease when doing these tasks.
Copying of a file usually refers to a "temporary" copy of the file's contents. Through the introduction at the beginning of this section, we should understand that the hard links and soft links of files are also "copying of files" in a sense. The former copies the file content synchronously, and the latter "copies" synchronously in the case of reading and writing. "File content. For example:
use
cpcommand to copy files normally (copying directories requires
-roptions)
$ cp regular_file regular_file_copy$ cp -r diretory_file directory_file_copy
Create hard link (
linkand
copyThe difference is that the latter is updated synchronously, but the former is not. After copying, the two are no longer relevant)
$ ln regular_file regular_file_hard_link
Create soft link
$ ln -s regular_file regluar_file_soft_link
Modifying the file name actually only modifies the file name identifier. can pass
mvcommand to modify the file name (i.e. rename).
$ mv regular_file regular_file_new_name
Editing a file is actually manipulating the content of the file, which corresponds to the editing of ordinary text files. This mainly involves reading, writing, appending, deleting, etc. of the file content. These tasks are usually done through specialized editors, such as command-line editors.
vim,
emacsand graphical interface
gedit,keditwait. If it is some specific files, there will be special editing and processing tools, such as image processing software
gimp, document editing software
OpenOfficewait. These tools generally have dedicated tutorials.
The following is a brief introduction to these common editing operations of files through redirection under Linux.
Create a file and write
abcde
$ echo abcde > new_regular_file
Add another line to the above file
abcde
$ echo abcde >> new_regular_file
Read a file line by line
$ while read LINE; do echo $LINE; done < test.sh
Tip: If you want to execute a string variable containing a redirection as a command, use
evalcommand, otherwise the redirect cannot be interpreted. For example,
$ redirect=echo abcde >test_redirect_file$ $redirect #Here > will be printed as a character > instead of interpreted as a redirect abcde >test_redirect_file$ eval $redirect #This will interpret > as a redirect$ cat test_redirect_fileabcde
Compressing and decompressing files is to facilitate the transmission of file content in a certain sense, but it may also have some specific uses, such as kernel and file system image files, etc. (For more related knowledge, please refer to subsequent materials).
Here are just a few common compression and decompression methods:
tar
$ tar -cf file.tar file #Compress $ tar -xf file.tar #Decompress
gz
$ gzip -9 file $ gunzip file
tar.gz
$ tar -zcf file.tar.gz file$ tar -zxf file.tar.gz
bz2
$ bzip2 file$ bunzip2 file
tar.bz2
$ tar -jcf file.tar.bz2 file$ tar -jxf file.tar.bz2
From the above demonstration, it should be very clear
tar,
bzip2,bunzip2,
gzip,gunzip
Is it the role of command? If it's not clear yet, do more and compare some of the above commands and check their manuals:man tar`...
File search refers to finding the location of files with certain attributes in a file system in a certain directory hierarchy. If this location is extended to the entire network, it can be expressed as a
URLAddress, for a local address, can be expressed as
file://+local path. The local path in Linux system starts with
/To begin with, for example, each user's home directory can be represented as:
file:///home/. The following only introduces some methods of local file search.
findThe command provides a "just-in-time" search method. Based on the user's request, it traverses all files in the specified directory hierarchy until the required file is found. and
updatedb+locateProvides a "fast" search strategy,
updatedbUpdate and generate a local file database, while
locateSearch this database by file name to quickly find the corresponding file. The former supports searching through various file attributes and provides an interface (
-execoption) is used to process the searched files. Therefore, it provides great convenience for fans of "single command" scripts, but for searches based on file names,
updatedb+locateThis method will significantly improve search efficiency. The following is a brief introduction to these two methods:
findDemonstration of basic command usage
$ find ./ -name *.c -o -name *.h #Find all C language files, -o is or $ find ./ ( -name *.c -o -name *.h ) - exec mv '{}' ./c_files/ ;# Move the found files to c_files. This usage is very interesting.
The above usage can be used
xargscommand substitution
$ find ./ -name *.c -o -name *.h | command, for example, I need to fix
Change all filename suffixes to uppercase.
$ find ./ -name *.c -o -name *.h | xargs -i ./toupper.sh '{}' ./c_files/
toupper.shIt is a processing file that we need to implement to convert lowercase to uppercase. The specific implementation is as follows:
$ cat toupper.sh#!/bin/bash# the {} will be expanded to the current line and become the first argument of this scriptFROM=$1BASENAME=${FROM##*/}BASE=${BASENAME%.* }SUFFIX=${BASENAME##*.}TOSUFFIX=$(echo $SUFFIX | tr '[az]' '[AZ]')TO=$2/$BASE.$TOSUFFIXCOM=mv $FROM $TOecho $COMeval $COM
updatedb+locateBasic usage demonstration
$ updatedb #Update library $ locate find*.gz #Find all gz compressed packages containing the find string
In fact, in addition to the above two commands, there are also command search tools under Linux:
whichand
whereis, the former is used to return the full path of a certain command, while the latter is used to return a certain command, source file,
The path to the man file. For example, findAbsolute path to find` command:
$ which find/usr/bin/find$ whereis findfind: /usr/bin/find /usr/X11R6/bin/find /usr/bin/X11/find /usr/X11/bin/find /usr/man/man1/ find.1.gz /usr/share/man/man1/find.1.gz /usr/X11/man/man1/find.1.gz
It should be mentioned that if you want to search for a file based on its content, then
findand
updatedb+locateas well as
which,
whereisThere is nothing we can do, the alternative is
grep,
sedWait for the command, the former is added
-rIn the future, the parameter can be used to search for the specified file content in the files in the specified directory, and then use
-iAfter passing the parameters, the file content can be replaced. Their basic usage has been introduced in detail in the previous chapters and will not be repeated here.
It is worth emphasizing that these commands are very meaningful for file operations. They abstract the file system structure to a certain extent, simplifying the operation of the entire file system into the operation of a single file. If a single file only considers the text part, it will eventually be converted into the previous string operation. That is what was discussed in the previous section. In order to have a clearer understanding of the organizational structure of files and the relationships between files, the file system will be discussed in depth in the next section.
Looking at Linux virtual file system from file I/O
Linux file system analysis
"Linux Core" Chapter 9 File System
Linux Device Drivers, 3rd Edition
Tips: Some tips for Linux I/O redirection
Loading, parsing and example analysis of ELF file dynamic link in Linux under Intel platform:
part1,
part2
Shell script debugging technology
Summary of ELF file format and program loading execution process
C language programming under Linux - file operations
File operation part of C language programming under Linux
Filesystem Hierarchy Standard
Learn to recover deleted Ext3 files in Linux system
Use mc to recover deleted files
Linux ext3 accidental deletion and recovery principle
A complete list of Linux compression/decompression methods
Everything is a byte
Considering the importance of files and file systems, it will be introduced in three subsections: files, file systems, programs and processes. In the "File" section, we mainly introduce the basic attributes and regular operations of files. In the "File System" section, we will discuss in depth the various parts of the Linux file system (including the structure of the Linux file system and the general structure of a specific file system. Analysis, the working principle of the underlying driver), the "Programs and Processes" section will specifically discuss the relevant content of executable files (including different program types, loading and execution processes, interactions between different processes [command pipes and unnamed pipes, Signal communication], control of processes, etc.)
It is necessary to discuss clearly the meaning of directory size. In addition, it is best to take all conventional file operations into consideration, including file reading, writing, execution, deletion, modification, copying, compression/decompression, etc.
I just came back from Shanghai in the afternoon. The result of the competition was "bad", but it is no longer important now. The key is that through the finals, I discovered many shortcomings, discovered the key role of design in system development, and discovered that Shanghai is a beautiful city. SJTU is also a beautiful university. When I got back, I started to sort out this blog that I had missed for two weeks due to the competition.
On December 15th, add file search part