linuk related commands

1, each generally have three Linux file permissions r-- read, w-- write, x-- executed, corresponding to a value of 4,2,1.

Input ll can view the file permissions.

 

 

2, to the directory or file authorization

chmod 777 directory name

chmod 775 filename

3, see the directory file

ls

4, view the catalog details (including rights, time, user, and the total number of directories)

ll

4, to see what has been done in a directory operation

history | grep directory name

5, create a folder

mkdir -p :-p Note folder name representatives to ensure that the directory name exists, it does not exist to build a

 

Create a directory: mkdir (make directories)

 

Function: to create the directory 
Syntax: mkdir [-p] [- help ] [- version] [- m < directory attribute>] [directory name]
Supplementary note: mkdir directory can be established and also set directory permissions.
Parameters:
  -m <directory attributes> or -mode <Directory Properties> Settings directory permissions when you create a directory at the same time.
  -p or -parents if you want to create the directory parent directory has not yet been established, will together establish the parent directory.
Example: mkdir test

 

6, create a file

touch filename

 

Create a file touch

 

功能说明:改变文件或目录时间。
语  法:touch [-acfm][-d <日期时间>][-r <参考文件或目 录>][-t <日期时间>] [--help]   [--version][文件或目录...] 或 touch [-acfm][--help][--version][日期时 间][文件或目录...] 
补充说明:使用touch指令可更改文件或目录的日期时间,包括存取时间和更改时间。
参  数:
 -a或–time=atime或–time=access或–time=use  只更改存取时间。 
 -c或–no-create  不建立任何文件。 
 -d<时间日期>  使用指定的日期时间,而非现在的时间。 
 -f  此参数将忽略不予处理,仅负责解决BSD版本touch指令的兼容性问题。 
 -m或–time=mtime或–time=modify  只更改变动时间。 
 -r<参考文件或目录>  把指定文件或目录的日期时间,统统设成和参考文件或目录的日期时间相同。 
 -t<日期时间>  使用指定的日期时间,而非现在的时间。
例:touch test.txt (注:Linux下没有文件后缀名区分文件类型之说,系统文件类型只有可执行文件和不可执行文件)

 

 

 

Guess you like

Origin www.cnblogs.com/zhengjinsheng/p/10948941.html