liunx basic command _002

File Operations

1, ls -l - Details show the current directory

2, ls -l -h - shows in detail the current directory files, and file size to more clearly see the way

3, mkdir - create a directory

4, mkdir -p directory name - create directories recursively

5 ,. - represents the current directory

6 .. - on behalf of parent directory

7, cd ../-- return to the previous level *

8, pwd - show current directory absolute path

9, touch the file name - Create a file

10, mv file you want to move a moving target address - moving files, multi-layer address to write the whole directory

11、mv  test.txt  test.txt.bak  改名

File Viewer

12, cp abc.text a copy command

13, mv * .txt a - all move to a directory

14, cp * .txt ../ copy all files to the parent directory txt

15, mv -f * .txt a - not prompted to overwrite the file

16, bin - execute directory

17, sbin - system command

18, etc - configuration files

19, tmp - temporary directory

20, opt - file directory

21, cd ~ home directory

22, cd / back to the root directory

23, cat aaa - View all files are smaller files can be displayed full

24, more aaa - in proportion to view files

25, less aaa - you can view the row direction keys, see the process by q quit

26, head aaa - from the beginning to see

27, head -6 aaa - See the first six rows

28, tail -f aaa - start with the tail, dynamic view files

29, tail -20 aaa-- view the end of the line 20

30, tail aaa default view line 10

31, cat aaa> test - Redirection

32, cat aaa >> test - Append

33, echo '11111' - Print 1111

34, echo '1111' >> aaa - 1111 log appended

Competence

liunx is a multi-user multi-tasking

etc directory

cat / etc / passwd store user information

Each row is a user, the user name separated by a colon process : password : user ID : Group ID : Annotated Description : home directory : login Shell

 Password is not written in the current file

Password positions: head / etc / shadow store user is a user password each row and separated by: --- username: password

 

Login : password encryption : Last Modified : minimum time interval : maximum time interval : Warning time : No Time : Time : Logo

 head  /etc/group

Group Name : Password : Group ID : the group user list

Create a user  

useradd  test

passwd  123456

       123456

After creating a user - see the following three files are inserted into the data

cat /etc/passwd

  --testjq:x:1005:1005::/home/testjq:/bin/bash

tail -l /etc/shadow

  --testjq: !!: 18045: 0: 99999: 7 ::: // !! representatives did not set a password

  --ningjq001: $ 1 $ Nkq.wHEQ $ RTyrBRkh1tPj7z / dGqwI30: 18044: 0: 99999: 7 ::: // password

tail  -1 /etc/group  testjq:x:1005:   

Change the user password: passwd testjq user

enter password

Enter the password again

[root@VM_0_7_centos ~]# su test
[test@VM_0_7_centos root]$

$:代表普通用户

#:代表管理员用户

普通用户没有根目录权限

权限

-rw 所属用户权限 r-- 组权限 r-- 其他用户权限

第一位代表当前文件的类型

d:代表目录

-:代表文件

l:代表软连接

rwx  :读、写、执行

r -4

w-2

x-1

chmod  777  文件名  --修改目录的文件权限

进入目录就得有读、又有执行权限

恢复权限

chmod  o=-   文件名  --将文件other改成没有任何权限

chmod   g+x  --给组追加权限

chown  root:aaa  修改文件的拥有值

 

Guess you like

Origin www.cnblogs.com/njq666/p/10943151.html