The second week Marco education

File type under Linux

  • Regular file (-)
  • Catalog (d)
  • Soft links (links character L)
  • Socket file (S)
  • Character device (S)
  • Block device (B)
  • Conduit files (named pipe P)

Absolute path with a forward slash /, the root directory of the beginning of the complete file path location can be used whenever you want to specify a file name

Relative path name does not begin with a slash in general, refers to the path relative to the current working directory, special scene, the relative position of a particular directory can specify a file name as a short form

pwd (shows the current shell CWD absolute path)
cd (change directory) stat (see File Status)

touch (can be used to create an empty file or refresh time file)

cp (copy files or directories can be achieved in)

Common options
-i if the target already exists, before covering prompted to overwrite -r, -R recursively copy all the contents of the directory and internal -a archive, the equivalent of -dR --preserv = all, commonly used in the backup -d --no -dereference --preserv = links does not copy the original files, just copy the link name
mv (for mobile and can rename the file or directory)

Common options:
-i Interactive -f Force -b target exists, back up before overwriting

 rm command can delete files Note: This command is very dangerous, be careful, it is recommended to use mv instead of rm 

tree (tree display) mkdir (create directory) rmdir (remove empty directories)

The essence gave a hard link from the file a new name, the essence is the same file
a symbolic link to another file, soft links and file the original document is not essentially the same text
input (read data), output (output data )

1> or> STDOUT redirected to the file 2> The STDERR redirected to a file, &> to redirect all output to a file

Pipe (using the symbol "| '' shown) for connecting the plurality of command

3A certification to verify the identity of authorized users, different users to set different permissions audit

passwd: you can modify the user password (x), shadow (with login name)

useradd (You can create a new linux user), usermod (you can modify user properties), userdel (delete linux user) id (you can view the user's UID, GID and other information)

SU (user identity can be switched, and execute the command as the specified user)

su UserName: nonlogin type switch, does not read the target user's profile, does not change the current working directory

su- UserName: Log type switch, reads the target user's profile, switch to the home directory, complete switch

chage (user can modify the password policy), chfn (designated personal information), chsh (designated shell), finger (you can view the user's personal information)

groupadd (implementation creates group), groupmod (modifying group), groupdel (Delete Group), gpasswd (change the group password), newgrp (temporarily switch the main group), groupmems (management group membership)

groups (see User Group Relations) chown (you can modify the file owner, can also modify the files belong to the group), chgrp (can be modified only belong to group files) chmod (modify file permissions)

(R) read 4, (w) writing 2, (x) performing a

 

Guess you like

Origin www.cnblogs.com/yuanxinlei/p/12588544.html