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:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.2. List contents of a directory or multiple directories
The basics of How to use Linux (如何使用Linux,基础笔记一)教程在这里插入图片描述
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. The basics of How to use Linux (如何使用Linux,基础笔记一)教程

e.g. Get more detailed info of contents under the current directory
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
e.g. Get more more detailed info of contents under the current directory, and contents are listed by the modified time
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
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 basics of How to use Linux (如何使用Linux,基础笔记一)教程


The detailed introduction of “ls” 's options and arguments:
Cite from Linux command line
1.4. Long format of the file info
e.g. The basics of How to use Linux (如何使用Linux,基础笔记一)教程
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.
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
“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.
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.4.4. The name of file owner:
e.g.
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.4.5. The name of group users:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.4.6. The size of a file (byte):
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.4.7. The last modification time:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
1.4.8. The name of a file:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程

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:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
e.g.
The basics of How to use Linux (如何使用Linux,基础笔记一)教程

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:
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
e.g.
The basics of How to use Linux (如何使用Linux,基础笔记一)教程
在这里插入图片描述
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:
在这里插入图片描述

标签: Linux, file, directory, more, less, basics, contents

相关文章推荐

添加新评论,含*的栏目为必填