The basics of How to use Linux (如何使用Linux,基础笔记一)

The basics of how to use Linux (Note One)

Outline:
ls - list contents of the directory
file - check the file type
less - look through contents of the file

1. ls

“ls” is a common command used by people, and we can use it to see contents of the directory, directory’s attributes and important files.

1.1. List out all files and sub directories under the current dirctory:
在这里插入图片描述
1.2. List contents of a directory or multiple directories
在这里插入图片描述在这里插入图片描述
1.3. Get more info by using arguements and options
A mojority of commands support to usre the options and arguments, and they adhere after the command.
e.g. 在这里插入图片描述

e.g. Get more detailed info of contents under the current directory
在这里插入图片描述
e.g. Get more more detailed info of contents under the current directory, and contents are listed by the modified time
在这里插入图片描述
e.g. Get more more detailed info of contents under the current directory, and contents are listed by the modified time then reverse the order.
在这里插入图片描述

The detailed introduction of “ls” 's options and arguments:
Cite from Linux command line
1.4. Long format of the file info
e.g. 在这里插入图片描述
1.4.1. The first char means the type of files:
Begin with “d” : directory
Begin with “-” : a normal file

1.4.2. The access permission:
e.g.
在这里插入图片描述
“rw-” owner permission: read, write and non-execute
“r–” group permission: only read
“r–” other permission: only read

1.4.3. The number of hard link:
e.g.
在这里插入图片描述
1.4.4. The name of file owner:
e.g.
在这里插入图片描述
1.4.5. The name of group users:
在这里插入图片描述
1.4.6. The size of a file (byte):
在这里插入图片描述
1.4.7. The last modification time:
在这里插入图片描述
1.4.8. The name of a file:
在这里插入图片描述

2. Check the file type (less)

The file" command can be used to check a file type and get other info. In the unix-like system, there is a saying that everything is file.

The usage:
在这里插入图片描述
e.g.
在这里插入图片描述

3. Using “less” to look through contents of a file “less” command is a program to look text files.

Tips:
Cite for Linux command line
Cite from Linux command line
3.1. The usage:
在这里插入图片描述
e.g.
在这里插入图片描述
在这里插入图片描述
if you want to exit the less program, you could click the keyboard with “q”.

3.2. Some function tips for less program
when you are using the less program, you can control the program by these commands.
在这里插入图片描述
在这里插入图片描述

tips:
在这里插入图片描述

发布了20 篇原创文章 · 获赞 3 · 访问量 266

猜你喜欢

转载自blog.csdn.net/qq_34515959/article/details/96140450
今日推荐