File and directory operations

  

Like other operating systems, user data and programs are stored as files in Linux. Therefore, in the process of using Linux, it is often necessary to operate on files and directories. Now let's take a look at the file and directory operations under Linux from the standpoint of a Window user. 1. File Name and File Type The file name is the identifier of a file. From this perspective, the rules for file names are basically the same as those under Windows 9x. It is also composed of letters, numbers, underscores, and dots. The maximum length is 255 characters. Like Windows 9x, there are common files and directory files in Linux systems, but directory files are simply referred to as directories in Window. There is a special file in the Linux system, which is the device file. In a Linux system, each I/O setting is mapped to a file that can be handled like a normal file, which makes the file and device operations as uniform as possible. From the user's user, the use of I/O devices is almost the same as the use of general files, so that you don't have to know the details of the I/O devices. 2. Directory structure As in Windows, files are also organized in directories through Linux. But the difference is that there is only one root directory under Linux, not one root partition like Windows. If you have multiple partitions, you need to mount the other partitions to the root directory. When you recall that there was an option to fill in the Linux partition, it was Mount Point. We wrote one of them as “/”, which is the root directory (this is the opposite of Windows, one is “\\” One is “/”, it is a natural family.) Others may be /home, /usr. After installing the system, you will find /home, /usr is the home, usr directory under the root directory! By the way, the entire partition is used for this directory. After installing Linux, there are many directories. Below we will explain some important directories: /bin: Stores more than one hundred common commands and tools under Linux. /dev: Stores all device files under Linux! /home: User home directory, each built a user, will create a new directory with the same name here, give the user a space of their own /lost+found: As the name suggests, some missing files may be found here /mnt: The mount point of the external device, usually with two subdirectories cdrom and floppy! Its presence simplifies the use of discs and floppy disks. Just plug in the CD and run: mount /mnt/cdrom, you can mount the contents of the CD to /mnt/cdrom and you can access it. However, after you are done using it, you should leave the directory and execute umount /mnt/cdrom. Similarly, floppy disks are mount /mnt/floppy and umount/mnt/floppy. /proc: This is actually a fake directory, where you can access the contents of the memory. /sbin: This is where system-level commands and tools are stored. /usr: Commonly used to install various software /usr/X11R6 X Window directory /usr/bin and /usr/sbin Some post-installed commands and tools /usr/Include, /usr/lib, and /usr/share are some shared link libraries /usr/local are often used to install new software /usr/src Linux source /boot:Linux is booted from here /etc: stored here in Linux Most of the configuration files /lib: static link library /root: root user's home directory, this is one of the privileges! /var: Usually used to store some changes! /var/log: store the system log /var/spool: store some mail, news, print queues, etc. In addition, it should be noted that under Linux, the current directory & rdquo;, & ldquo; path & rdquo; and other concepts are under Windows the same.

Copyright © Windows knowledge All Rights Reserved