The first simple command:
LS, is to see the current working path of the files are what, commonly used in a few parameters
1. ls-a indicates that the file below the current directory is listed in alphabetical order.
2, ls-l to list the details of each file, as to what is the details, you can see the following
ls-l (This parameter is the lowercase of the letter L, not the number 1)
This command can use the long format to display the contents of the file, if you need to see more detailed file information, it is necessary to use the Ls-l this command. For example, if I type ls-l in a directory, the following information may be displayed (the top two lines are my own):
location
1 2 3 4 5 6 7
number of file properties files The group file size file name to which the owner belongs
drwx------2 Guest users 1024x768 21:05 Mail
-rwx--x--x 1 root root 89080 Nov 7 22:41 tar*
-rwxr-xr-x 1 root bin 5013 9:32 uname*
lrwxrwxrwx 1 root root 4 Nov 19:30 zcat->gzip
-rwxr-xr-x 1 root bin 308364 Nov 7:43 zsh*
-rwsr-x---1 root bin 9853 5:46 su*
Now, let me explain what these displays mean.
The first field that represents the properties of the file. Linux files are basically divided into three properties: readable (R), writable (W), executable (x). But here are 10 squares to add (when the actual program is implemented, it is actually 10 bit bits). The first small is a special representation, indicating a directory or a link file, and so on, d means a directory, such as drwx------; L represents a Nexus file, such as lrwxrwxrwx, or a horizontal "-" indicating that this is a file. The rest of the grid is one unit per 3 squares. Because Linux is a multi-user multitasking system, so a file may be used by many people at the same time, so we have to set the permissions of each file, its file permissions are arranged in the order of the location (in-rwxr-xr-x for example):
rwx (Owner) r-x (Group) r-x (Other)
This example indicates that the user is readable, writable and executable, the same group of users can be read, not writable, executable, other users can read, not write, can be executed. In addition, some of the execution of the program properties is not X, but s, which means that the user who executes the program may temporarily have the same power as the owner to execute the program. Generally appear in the system management such as instructions or programs, let the user execute, with root identity.
the second field, which indicates the number of files. If it is a file, then this number is naturally 1, if it is a directory, then it is the number of files in the directory.
The third field indicates the owner of the file or directory. If the user is currently in their home, then this column is probably the name of its account.
The fourth field indicates the group to which it belongs. Each user can have more than one group, but most of the users should belong to only one group, but only if the system administrator wants to give a user special permission, he or she may be given another group.
The Fifth column indicates the file size. The file size is expressed in byte, and the empty directory is generally 1024byte, you can of course use other parameters to make the file display of different units, such as the use of ls–k is the KB to display a file size unit, but generally we still mainly byte-based.
The Sixth field indicates the date of creation. Expressed in "month, day, time" format, such as 15 5:46 for August 15 5:46 minutes.
The Seventh field indicates the file name. We can display the hidden file name with Ls–a.
3, after running the LS command, will display all the files in the current directory, the colors of these files are different, so what does the different colors mean?
White: Normal file Blue: Directory green: Executable file red: Compressed file cyan: Link file Brown: Device file
CD, all kinds of parameters do not say, also remember not too, but for me just contact with Linux, the various paths between the jump to see a little blurred, carefully read the various types of paths between the jump, found to remember the following several principles to understand more
1, access the path, each two-layer path between the "/" separated, and this symbol is exactly the same as the root of the symbol, so my small white easily confused.
2, the access path is divided into absolute path and relative path, absolute path access regardless of which path you are now, but as long as the cd/a/b ...., so that a layer of path to write down to know the path that you want to access, where the first slash represents the root directory, the next slash represents the delimiter between two layers of paths A relative path means counting from the current working path or current path, and then finding the location that you want to access, with two conventions in relative access to remember, '. ' Indicates the current working path, and '. ' Represents the current working path of the previous layer path, such as folder a under the A1 and A2 two folders, A1 below have B, C, D, e four folders, A2 below have F, g, H, I four folders, the current working path under A1, want to access by relative path to access the A2 below the F folder, can write CDs. /a2/f, sometimes in the last layer of the path after the addition of a '/', I tried, add not all can achieve the purpose, so I generally do not add, according to these principles, then access to the previous layer of the previous path is a CD. /.., it's good to understand,/represents the delimiter between two layers of paths, and. Represents the previous layer path.
3, access to any path under the current path, you can directly write the path name, for example, in the above said, join the following work under A1, want to go to the B folder, then directly CD B or CD./b, the first one is written in this article, the second one is because '. ' Indicates that the current path '/' represents a separation between two layers of paths;
4, the front said a lot of current work path, to see the current work path as long as the input pwd is OK.
5, direct input CD nothing plus or CD ~ is to jump to the user's own directory.
6, CD-to jump back to the working directory before, L for example, originally in A1 B inside, and then jumped to the A2 f inside, then input CD-will jump back to B.
7, in the CD and the following parameters to add a space ah, all the commands are like this, the direct input will be invalid.
The questions left by learning today:
The concept of "group" in the attributes of a file is not very clear;
Linux Learning Note 2016.03.11