Linux commands-file, Disk Management
1.文件管理 <1>查看文件信息:ls ls是英文单词list的简写,其功能为列出目录的内容,是用户最常用的命令之一,它类似于DOS下的dir命令。 Linux文件或者目录名称最长可以有265个字符,“.”代表当前目录,“..”代表上一级目录,以“.”开头的文件为隐藏文件,需要用 -a 参数才能显示。 ls常用参数:
| Parameters |
meaning |
| -A |
Displays all subdirectories and files in the specified directory, including hidden files |
| -L |
Display file details in a list |
| -H |
Display file size in a humane way with-l |
The information listed in the figure has the following meanings:
Wildcard characters:
| wildcard characters |
meaning |
| * |
file represents all characters in a file name |
| ls te* |
Find a file that starts with Te |
| ls *html |
Find the file that ends with HTML |
| ? |
represents any one of the characters in the file name |
| ls?. C |
find only the first character, the file with the suffix. C |
| ls a.? |
only 3 characters are found, the first 2 characters are a., the last character arbitrary file |
| [] |
["and]" encloses a group of characters, which means that you can match any one of the character groups. "-" is used to represent the range of characters. |
| [ABC] |
matches any of a, B, C |
| [a-f] |
matches any one of the characters from a to F range |
| ls [a-f]* |
Find a file that starts with any of the characters from a to F range |
| ls a-f |
find article A file named A-f, when "-" is outside the square brackets. |
| \ |
If you want to use wildcards as normal characters, you can precede them with escape characters. “?” and "*" in square brackets without the use of escape characters to lose the role of a wildcard character. |
| ls *a |
find files with file name *a |
My python growth path -03