Linux: 1. Linux file systems start from/. in file management of Linux operating systems, the command line mode (in the console or terminal) file or directory management involves the concept of path, which is the most basic basis for Linux command line operations. If we understand...
Linux: 1. Linux file systems start from/. in file management of Linux operating systems, the command line mode (in the console or terminal) file or directory management involves the concept of path, which is the most basic basis for Linux command line operations. If we understand the concept of path, we can enter any directory as we like and do what we want. A Linux file system is a tree-like structure that uses/as the entry, and/(also known as the root directory) has subdirectories, such as etc, usr, and lib, there are files or subdirectories under each subdirectory, which forms a tree structure, which is relatively simple. What about Windows file systems? It introduces the concept of disk C and disk D, so that users who are used to Windows operations will find that Linux has the concept of disk C and disk D, sometimes even at a loss. 2. Understanding the Concept of path; www.2cto.com introduces the concept of path to find the directory or file we need. For example, if we want to edit the file.txt file, we first need to know where it is stored, that is, we need to point out its location, and then we need to use the path. 3. path components. a path consists of a directory or directory and a file name. For example,/etc/X11 is a path, and/etc/X11/xorg. conf is also a path. That is to say, the path can be a combination of directories, which can be classified in depth or composed of file records and files. For example, we want to use vi to edit xorg. conf file. enter vi/etc/X11/xorg in the command line. conf. if you want to enter the/etc/X11 directory, you can use cd/etc/X11. 4. command pwd 5 to determine the current working directory of the user. in Linux, the absolute path starts from/(also known as the root directory, for example,/usr and/etc/X11. If a path starts from/, it must be an absolute path, so you can understand it. www.2cto.com [root @ localhost ~] # Pwd note: determine the user's current location, that is, where is the user's location? /Root note: The user is currently at/root; [root @ localhost ~] # Cd/usr/share/doc/note: we enter the/usr/share/doc directory in an absolute path; [root @ localhost doc] # pwd note: determine the current user location/usr/share/doc note: The user is located in/usr/share/doc, it seems that our goal has been achieved; 6. relative path; relative path is. or .. start ,. indicates the location of the user's current operation, and .. indicates the parent directory. in the path ,. indicates the current directory of the user, and .. upper-level Directory. and .. as a directory. [Root @ localhost ~] # Pwd note: pwd is used to determine the location of the current user./root note: The Directory is in the/root directory. [root @ localhost ~] # Cd. note: go to. [root @ localhost ~] # Pwd note: determine the location of the current user;/root note: obtained in the/root directory; www.2cto.com [root @ localhost ~] # Cd .. note: We cut into the/root parent directory [root @ localhost/] # pwd note: determine the location of the current user. /NOTE: The user is currently in the/(root directory); 7. in some documents, we see examples of running a script or program similar to./filename. In fact, it runs in the current user directory; author: ruan200885
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