Linux first week study notes (a)
2.3:ls Command
ls–l Commands: Listing file details
Ls–i Command : View Inode number
LS–LH command: View file size
Ls–la commands: View all files and hidden files
Ls–lt command: Sort by Time order
Ls–ld command: Lists only the directory itself ( D do not add files and directories below the directory list)
which ll commands: Viewing aliases
ll is a ls–l an alias for
2.4: File type
After viewing a file using the Ls-l command, the first column on the left indicates the device type
D: Indicates directory
-: Denotes normal file (contains text documents and binary documents with color marks)
C: Device that represents a string (for example: mouse, keyboard)
L: Software connection or hard connect file (soft connection is equivalent to a shortcut)
S: Communication files (e.g., communication between processes)
Cat commands: Can view plain text documents, color-coded binary documents cannot be opened
--------------------------------------------------------------------------------------------------------------- ----
-rw-------. 1 root root 1418 1 Month 08:19 anaconda-ks.cfg
-RW-------( permissions How many files use the same inode" root ( (owning group) 1418 (File size 1.4k ) 1 month 08:19 (file creation time) anaconda-ks.cfg (file name)
--------------------------------------------------------------------------------------------------------------- -----
[Email protected] ~]# ls-i anaconda-ks.cfg
33581218 anaconda-ks.cfg
--------------------------------------------------------------------------------------------------------------- ------
[Email protected] ~]# LS-LH anaconda-ks.cfg
-rw-------. 1 root root 1.4K 1 Month 08:19 anaconda-ks.cfg
[Email protected] ~]# Ls-la
Total Dosage -
Dr-xr-x---. 3 root root 147 1 months 22:37.
dr-xr-xr-x. Root root 265 1 Month 22:48.
-RW-------. 1 root root 1418 1 months 08:19 anaconda-ks.cfg
-RW-------. 1 root root 935 1 Month 05:47. Bash_history
-rw-r--r--. 1 root root for each month , bash_logout.
-rw-r--r--. 1 root root 176 month . Bash_profile
-rw-r--r--. 1 root root 176 month . BASHRC
-rw-r--r--. 1 root root for the month of CSHRC.
drwx------. 2 root root 1 months 04:29. SSH
-rw-r--r--. 1 root root 129 month . TCSHRC
[Email protected] ~]# Ls-lta
Total Dosage -
-RW-------. 1 root root 935 1 Month 05:47. Bash_history
drwx------. 2 root root 1 months 04:29. SSH
dr-xr-xr-x. Root root 265 1 Month 22:48.
Dr-xr-x---. 3 root root 147 1 months 22:37.
-RW-------. 1 root root 1418 1 months 08:19 anaconda-ks.cfg
-rw-r--r--. 1 root root for each month , bash_logout.
-rw-r--r--. 1 root root 176 month . Bash_profile
-rw-r--r--. 1 root root 176 month . BASHRC
-rw-r--r--. 1 root root for the month of CSHRC.
-rw-r--r--. 1 root root 129 month . TCSHRC
[Email protected] ~]# Ls-la
Total Dosage -
Dr-xr-x---. 3 root root 147 1 months 22:37.
dr-xr-xr-x. Root root 265 1 Month 22:48.
-RW-------. 1 root root 1418 1 months 08:19 anaconda-ks.cfg
-RW-------. 1 root root 935 1 Month 05:47. Bash_history
-rw-r--r--. 1 root root for each month , bash_logout.
-rw-r--r--. 1 root root 176 month . Bash_profile
-rw-r--r--. 1 root root 176 month . BASHRC
-rw-r--r--. 1 root root for the month of CSHRC.
drwx------. 2 root root 1 months 04:29. SSH
-rw-r--r--. 1 root root 129 month . TCSHRC
[Email protected] ~]# ls-d/root/
/root/
[Email protected] ~]# ls-l/root/
Total Dosage 4
-rw-------. 1 root root 1418 1 Month 08:19 anaconda-ks.cfg
[Email protected] ~]# ls-ld/root/
dr-xr-x---. 3 root root 147 1 Month 22:37/root
[Email protected] ~]# ls-l
Total Dosage 4
-rw-------. 1 root root 1418 1 Month 08:19 anaconda-ks.cfg
[email protected] ~]# LL
Total Dosage 4
-rw-------. 1 root root 1418 1 Month 08:19 anaconda-ks.cfg
-------------------------------------------------------------------------------------------------------------
[email protected] ~]# which LL
Alias ll= ' Ls-l--color=auto '
/usr/bin/ls
--------------------------------------------------------------------------------------------------------------
-----------------------------------thels command parameter ------------------------------------------------------------- ----
-A : Displays all files and directories ( ls default file name or directory name is " . "As a shadow, will not be listed);
-A : Show save Shadow File " . "and" .. "List of all files except;
- C : Multiple columns display the output results. This is the default option;
- L : With " - C "option function instead, all output information is output in a single column format, not output as multiple columns;
- F : Append the type identifier of the file after each output item, meaning: " * "represents an ordinary file with executable permissions," / "represents the directory," @ "denotes symbolic links," | "represents the command pipeline FIFO , " = "represents Sockets sockets. When the file is a normal file, do not output any identifiers;
- b : Outputs the non-output characters in the file with the backslash "" and the character encoding;
- C : With " -lt option, the output directory content is sorted by file status time, sorted by the file's index node CTime field. When in conjunction with the "-L" option, the ordered sentence is the time of the file's state change;
- D : Displays only the directory name, not the list of contents under the directory. Displays the symbolic link file itself without displaying the list of directories it points to;
- F : The effect of this parameter and specifying both the AU "parameter is the same, and close the" LST "The effect of the parameter;
- I. : Displays the file index node number ( Inode ). An index node represents a file;
--file-type : With " - F "option is the same, but does not show" * ";
- k : To KB (Kbytes) Displays the file size for the units;
- L : Displays a list of the contents of the directory in a long format. The output information includes file name, file type, permission mode, number of hard connections, owner, group, file size, and last modification time of file, etc. from left to right .
- M : With " , The name of each file and directory in the section;
- N : Replace its name with User ID and group ID;
- R : Arranges and outputs the directory contents list in reverse order of the file name;
- S : Displays the size of files and directories, in chunks;
- T : Sort by the change time of files and directories;
- L : If you encounter a file or directory with a symbolic link, directly list the original file or directory that the link points to;
- R : Recursively handles all files and subdirectories under the specified directory;
--full-time : Lists the full date and time;
--color[=when] : Use different colors to highlight different types of.
Linux first week study notes (12)