Linux File types

Source: Internet
Author: User
Linux file types indicate that the file types in Linux are quite different from those in Windows. Linux file types and Linux file names represent two different concepts. We create filetxt and filetargz through general applications. These Linux file types indicate that the Linux system is different from the Windows system, and the file types of the two are also very different. Linux file types and Linux file names represent two different concepts. Similar to file.txt1_file.tar.gz created by a general application, although these files must be opened in different programs, most of them are normal files (also known as common files) that are measured in Linux file types ). Common types of Linux files include: common files, directories, character device files, block device files, and symbolic link files. now we will provide a brief description. 1. common files: [root @ localhost ~] # Ls-lh install. log-rw-r -- 1 root 53 K 03-16 08:54 install. log we use ls-lh to view the properties of a file. we can see that there is a file like-rw-r --. it is worth noting that the first symbol is -, such a file is a common file in Linux. These files are generally created using related applications, such as tools, document tools, archiving tools... or cp tools. To delete such files, run the rm command. 2 Directory: [root @ localhost ~] # Ls-lh total 14M-rw-r -- r -- 1 root 2 03-27 fonts. scale-rw-r -- 1 root 53 K 03-16 08:54 install. log-rw-r -- 1 root 14 M 03-16 kernel-2.6.15-1.2025_FC5.i686.rpmdrwxr-xr-x 2 1000 users 4.0 K 04-04 mkuml-2004.07.17drwxr-xr-x 2 root 4.0 K 04-19 mydirdrwxr-xr -x 2 root 4.0 K 03-17 Public when we execute in a directory, we can see that a file like drwxr-xr-x is a directory, which is a special file in Linux. Note that its first character is d. Run mkdir or cp to create a directory. cp can copy one directory to another. Delete the file by using the rm or rmdir command. 3-character device or block device File: If you enter the/dev directory and list the file, you will see a file similar to the following: [root @ localhost ~] # Ls-la/dev/ttycrw-rw-1 root tty 5, 0 04-19 08:29/dev/tty [root @ localhost ~] # Ls-la/dev/hda1brw-r ----- 1 root disk 3, 1 2006-04-19/dev/hda1 we can see that the property of/dev/tty is crw-rw -, note that the first character is c, which indicates the character device file. For example, for serial devices such as cats, we can see that the attribute of/dev/hda1 is brw-r -----. Note that the first character is B, which indicates a block device, such as a hard disk or a optical drive; files of this type are created using mknode and deleted using rm. Currently, in the latest Linux release, we generally do not need to create device files on our own. Because these files are associated with the kernel. Four interface files: when we start the MySQL server, a mysql. sock file will be generated. [Root @ localhost ~] # Ls-lh/var/lib/mysql. socksrwxrwxrwx 1 mysql 0 04-19 11: 12/var/lib/mysql. sock note that the first character of this file's attribute is s. Let's take a look. 5. symbolic link File: [root @ localhost ~] # Ls-lh setup. loglrwxrwxrwx 1 root 11 04-19 :18 setup. log-> install. log when we view the file properties, we will see lrwxrwxrwx, note that the first character is l, this type of files are linked files. Is a new file name through the ln-s source file name. The preceding example shows that setup. log is a soft link file of install. log. How can this problem be solved? This is similar to shortcuts in Windows. The preceding section describes the Linux file types. Example of creating a symbolic link file; [root @ localhost ~] # Ls-lh kernel-2.6.15-1.2025_FC5.i686.rpm-rw-r -- r -- 1 root 14 M 03-16 kernel-2.6.15-1.2025_FC5.i686.rpm [root @ localhost ~] # Ln-s kernel-2.6.15-1.2025_FC5.i686.rpm kernel. rpm [root @ localhost ~] # Ls-lh kernel *-rw-r -- 1 root 14 M 03-16 kernel-2.6.15-1.2025_FC5.i686.rpmlrwxrwxrwx 1 root 33 04-19 kernel. rpm-> kernel-2.6.15-1.2025_FC5.i686.rpm
Related Article

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.