Files and file suffix names under Linux

Source: Internet
Author: User
Tags php language print format perl script

1. Use the background meaning of the extension:

   When it comes to file types, you can think of Windows file types, such as file.txt, File.doc, File.sys, File.mp3, file.exe, etc., according to
The file's suffix can determine the type of file. But whether a file in Linux can be executed, and the suffix is not much of a relationship, mainly depends on the properties of the file. But we know the suffix of the Linux file is still necessary,
In particular, we create some of our own files, it is best to add the suffix name, so that the purpose is only for our convenience in the application. Now the Linux desktop environment is as intelligent as windows, and the file type is associated with the corresponding program. When we open a file, the system automatically determines which application is opened.
If this is the case, the Linux desktop environment and the Windows desktop are not much different. In Linux, the file with the extension can only represent the association of the program, and does not indicate that the file can be executed, in this respect, the extension of Linux does not make much sense.

2.linux File Type:

Linux file types are common: ordinary files, directories, character device files, block device files, symbolic link files, etc., although these files to be opened in different programs, but placed in the Linux file type is measured, mostly regular files (also known as ordinary files).

2.1 Normal file [[email protected]~]# LS-LH Install.log-rw-r--r--1Root root 53KGeneva- -  ,: Wuinstall.log we use LS-LH to see the properties of a file, you can see a similar-rw-r--r--, and it's worth noting that the first symbol is-, such files are normal files in Linux.
These files are typically created with some related applications, like tools, document tools, archive tools .... or CP tools. This type of file is deleted using the RM command;2.2 directory[[email protected]~]# LS-LH Total 14M-rw-r--r--1Root root2 Geneva- - Geneva:xxFonts.scale-rw-r--r--1Root root 53KGeneva- - ,: WuInstall.log-rw-r--r--1Root root 14MGeneva- - -: -kernel-2.6. the-1. 2025_FC5.I686.RPMDRWXR-xr-x2 +Users4.0KGeneva-Geneva at: -mkuml-2004.07. -drwxr-xr-x2Root root4.0KGeneva- + Ten: -MYDIRDRWXR-xr-x2Root root4.0KGeneva- - Geneva: -Public when we execute in a directory, see a similar drwxr-xr-x, such a file is the directory, directory in Linux is a more special file. Note that its first character is d.
The command to create a directory can be used with the mkdir command, or the CP command, where CP can copy a directory to another directory. Remove the RM or RMDIR command. 2.3 character device or block device file; If you enter/The Dev directory, listing the files, will see something like this; [email protected]~]# ls-la/dev/TTYCRW-rw-rw-1Root TTY5,0 Geneva- + ,: in/dev/Tty[[email protected]~]# ls-la/dev/HDA1BRW-R-----1Root disk3,1 2006-Geneva- +/dev/HDA1 We seeThe/dev/tty property is crw-rw-rw-, note that the first character in front is C, which represents the character device file. such as the cat and other serial devices, we seeThe/dev/hda1 property is brw-r-----, note that the first character in front is B, which indicates a block device, such as a hard disk, an optical drive, etc, this kind of file is created with Mknode and deleted with RM. Currently in the latest Linux distributions, we generally do not have to create the device files ourselves. Because these files are associated with the kernel. 2.4 Socket interface file; when we start the MySQL server, a mysql.sock file is generated. [[Email protected]~]# LS-LH/var/lib/mysql/mysql.socksrwxrwxrwx1MySQL MySQL0 Geneva- + One: A/var/lib/mysql/Mysql.sock Note that the first character of the property of this file is S. We'll just have a look. 2.5 Symbolic link file;[[Email protected]~]# LS-LH setup.loglrwxrwxrwx1Root root One Geneva- + One: -Setup.logInstall.log When we look at the properties of a file, we see a similar lrwxrwxrwx, noting that the first character is l and that such a file is a linked file. is through LN-s source filename new file name.
Above is an example that indicates that Setup.log is a soft link file for Install.log. How do you understand it? This is somewhat similar to the shortcuts in the Windows operating system. Example of how to create a symbolic link file [email protected]~]# LS-LH kernel-2.6. the-1. 2025_fc5.i686.rpm-rw-r--r--1Root root 14MGeneva- - -: -kernel-2.6. the-1. 2025_fc5.i686.rpm[[email protected]~]# ln-s kernel-2.6. the-1. 2025_fc5.i686.rpm Kernel.rpm[[email protected]~]# LS-LH kernel*-rw-r--r--1Root root 14MGeneva- - -: -kernel-2.6. the-1. 2025_fc5.i686.rpmlrwxrwxrwx1Root root - Geneva- + One: -KERNEL.RPM-kernel-2.6. the-1.2025_fc5.i686.rpm

3. Common file suffix name:

*.php------This everyone knows, is can use the PHP language interpreter to explain, can use the browser to open the file;*.so-------This class is a library file;*.doc *.OBT--------This is a file that the OpenOffice can open; bz2------bzip2 compressed files. GZ------gzip compressed files. Tar------Tar package file (the package file is not a compressed file). tbz------tar is packaged and compressed with bzip files. tgz-----tar is packaged and compressed with gzip files. Au-----audio file. gif-----gif image file. html/.htm-----HTML file. jpg-----JPEG image file. pdf------Electronic documents (in PDF format). png-----PNG image file. PS------postscinpt file (print format file). txt------plain text files. wav-----audio file. xpm-----image file. conf-------configuration file.Lock-------lock file (used to determine if a file or device is being used). RPM------Redhatpackage.manager File (Suite package or package). C-------C source program code file. CPP------C + +source program code files. h-------C or C + +the header file of the program. O------program destination file. pl------perl script file. so-----Class Library File

Files and file suffix names under Linux

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.