The. Sock file is also a special kind of file, which is usually used to connect data between networks, such as: We can start a program to listen to the client's requirements, the client can communicate through the socket:
Linuxthe file types in
File Type description
Linux systems differ from Windows systems in that they differ greatly in file types and file name extensions. the file types in Linux and the file extension for Linux files are more representative of the meaning and are different in Windows systems.
files created by generic applications or commands, such as file.txt,file.tar,gz, are opened with different programs or commands, but Linux is a regular file (also known as a normal file).
the suffix file extension that comes with it, in addition to making it easy for users who used to be accustomed to Windows, is not particularly meaningful for Linux systems, while windows the extension in the system is the type format that actually represents the file.
file types in Linux
in the Linux System, it can be said that all devices (including directories, ordinary files) are files. File types include ordinary files, directories, character device files, block device files, symbolic link files, and so on, respectively:
when the ls-l or ls-la command is executed, the result is displayed
[[email protected] ~]# ls-1 root root 937:27 anaconda-ks.cfgdrwxr2 root root 4096:40 Desktop128884: Install.log
The first column , 2~10 characters (such as rwxr-xr-x), is to describe the permissions of a file. The first character in the first column is a description of the file type, such as the above result has -,d and so on.
after Ls-l displays the contents of the file attributes, the first character of the first column is used to distinguish the file type;
D: Indicates that this is a directory-: This is anormal file L: Indicates that this is a symbolic link file, in fact it points to B, C: respectively, the block device and other peripherals S, p: These files relate to the system's data structure and piping Special reminders: Beginners First Master D, L, -These three kinds can be.
file types are described separately
Normal files (regular file):
[[email protected] ~]# ls-10: Test.txt
by using ls-l to view The properties of the Test.txt, you can see that the first column is -rw-r--r--, and it is worth noting that the first symbol is -( English character minus ) , in Linux , such a character begins with a normal file.
These files are typically created with related application or system commands, such as touch,cp,tar , and other tool commands. The RM command can be used to delete a normal command .
tip: doc,ppt,zip,jpg under windows documents in the same format as the Linux all belong to the ordinary file.
Catalog file (directoy):
[Email protected] ~]# ls-ld/home/zgy/drwx34096: +/Home /zgy/
as shown above, when you execute ls-ld/home/zgy/ , you can see that the first column contains the drwx------ , which begins with the D The character file represents the directory, and the directory is a very special file in Linux.
Tip: If you just want to see the directory permission attribute, you can use the- D parameter of LS and combine it with the ls-ld directory name.
the command to create a directory can be used with the Mdkir command, or the CP can copy a directory to another directory. Delete the command with rm-r or rmdir(delete empty directory only).
synchronization prompt: The following execution of the results of Ls-f, in the script can directly distinguish between the directory and files, each directory behind a diagonal.
[[email protected] ~]# ls-fanaconda-ks.cfg desktop/ install.log install.log.syslog Test.txt
In a production environment, it is common to filter out all of the catalog files in the following ways:
" / " "^d"
======= A brief description of the regular expressions involved =============
^: expressed in .... The beginning, such as "^D" means beginning with D $: denoted by .... End, as "d$" means ending with D
character device or block device file:
If you enter the /dev directory and list the files, you will see something similar:
[Email protected] ~]# ls-al/dev/sdabrw180ten:/ dev/~]# ls-al/dev/ttycrw150ten:26 /dev/tty
you can see that the/dev/tty property is crw-rw-rw-, note that the previous character is C, which indicates a character device file, such as a serial device such as a cat.
you can see that the/dev/sda property is brw-r----- , note that the previous character is b, which indicates a block device, such as a hard disk, an optical drive, and other devices.
Special Tip: How to view hardware changes in Linux:
[Email protected] ~]#/etc/init.d/ for hardware changes [ OK ]
set of interface files
When you start MySQL Service, a mysql.sock is generated . The first character of the property of this file is s:
The. Sock file is also a special kind of file, which is usually used to connect data between networks, such as: We can start a program to listen to the client's requirements, the client can communicate through the socket:
Mysql-uroot-ppass-s/data/3306/mysql.sock, this is the database client program connection server-side command, through the socket file and database server communication example.
Example:
Linuxthe file name extension in
In General,the files in Linux do not need to be extended, this is very different from Windows , we know that the Windows The end of the executable file extension is usually the. exe. com. bat, and in Linux The file can be executed to see if the x -bit of the permission bit has x, the picture file extension is usually . jpg. jpeg. gif. bmp. png .
The role of extensions under Linux
in Linux , although the extension doesn't really make sense, it's easy to be compatible with Windowsand most of us get used to Linux User-differentiated files, we are also accustomed to using extensions to represent different types of files. Examples are as follows
Appendix 1: parameters of the Find-type file type
Iii. file types and file name extensions in Linux systems