Linux Reference Note 4

Source: Internet
Author: User
Tags bz2

I. Administrative authority and Attribution 1. Permissions Overview Document Attribution owner (U): The user owning this file/directory-user belongs to Group (g): The group that owns this file/directory-group other users (o):-other access rights Read (R) for users other than the owner, the owning group : Allow view content-read write (w): Allow content to be modified-write executable (x): Allow to run and toggle-excute2. View Permissions ls-l # ls-l/etc/passwd-|rw-|r--|r--. 1 root root 2481 February 09:37/etc/passwd①②③④⑤⑥⑦⑧⑨⑩ permissions reading order: ⑩①⑥②⑦③④① file Type-file D directory L link ② owner's permission r = 4 Read W = 2 write x = 1 Executable-No ③ of the owning group R = 4 Read W = 2 write x = 1 executable-no ④ other user's rights R = 4 Read W = 2 write x = 1 executable-no ⑤ link Number file: Number of links Directory: how many subdirectories (. .. ⑥ owner ⑦ The owning group ⑧ file size ⑨ file creation time ⑩ File/directory name 3. change file Attribution # Chown Master: File/directory Change file/directory owner # chown: Genus group File/directory change the owning group of File/directory # Chown owner: Genus group File/directory change text The owner and the owning group of the pieces/directory-R recursive eg:[[email protected] ~]# rm-rf/tmp/*[[email protected] ~]# ls-ld/tmp/studir[[email  protected] ~]# mkdir/tmp/studir[[email protected] ~]# ls-ld/tmp/studir[[email protected] ~]# chown Student/tmp/studir/[[email protected] ~]# ID student[[email protected] ~]# useradd student[[email  Protected] ~]# ID student[[email protected] ~]# chown Student/tmp/studir/[[email protecTed] ~]# ls-ld/tmp/studir[[email protected] ~]# chown:users/tmp/studir/[[email protected] ~]# ls-ld/tmp/st Udir[[email protected] ~]# chown root:root/tmp/studir/[[email protected] ~]# ls-ld/tmp/studir4. Change file/directory Permissions chmod command format: chmod [ugoa][+-=][rwx] Document path ...-r: Recursive modification (with documents in all subdirectories and subdirectories) [[email protected] ~]# ls-ld/tmp/ Studir[[email protected] ~]# chmod g-rx,o-rx/tmp/studir/[[email protected] ~]# ls-ld/tmp/studir[[email  protected] ~]# chmod u-w,g=rx/tmp/studir/[[email protected] ~]# ls-ld/tmp/studir[[email protected] ~ ]# chmod a=rwx/tmp/studir/[[email protected] ~]# Ls-ld/tmp/studir II, Backup and recovery 1. Make/Release Zip package A. Compressed zip format: Zip [-ry] backup file. zip document path ... eg:[[email protected] ~]# ls-ld/boot/[[email protected] ~]# ls /opt/[[email protected] ~]# zip-ry/opt/boot_bak.zip/boot/[[email protected] ~]# LS/OPTB. Decompression format: Unzip backup file. zip [-D destination folder] Format: Unzip backup file. zipeg:[[email protected] ~]# ls/tmp/todir[[email protected] ~]# unzip-d/tmp/todir/opt/boot_bak.zip [[email protected] ~]# Ls/tmp/todir2. Making/Releasing. Tar Package A. Making a. Tar package and compressing the basic usage format: Tar- ZCPF backup files. tar.gz Document Path ... Format: TAR-JCPF backup file. tar.bz2 Document Path ... Format: TAR-JCPF backup file. Tar.xz document Path ... eg:[[email protected] ~]# ls-ld/var/log/[[email protected] ~]# Du-sh/var/lo G/[[email protected] ~]# mkdir-p/tmp/day03[[email protected] ~]# tar-zcpf/tmp/day03/log.tar.gz/var/log/[ [email protected] ~]# tar-jcpf/tmp/day03/log.tar.bz2/var/log/[[email protected] ~]# tar-jcpf/tmp/day03/ Log.tar.xz/var/log/[[email protected] ~]# du-sh/tmp/day03/*b. Extract the basic usage format for the TAR package: TAR-XPF backup file. tar.gz format: TAR-XF Backup files. tar.bz2 format: tar-xf backup file. tar.xz [-C destination Folder]eg:[[email protected] ~]# cd/tmp/day03/[[email protected] day03]# ls[[email protected] day03]# tar-xf log.tar.gz[[email protected] day03]# ls[[email protected] day03]# RM-RF var[[email protected] day03]# ls[[email protected] day03]# tar-xf log.tar.bz2[[email Protected] day03]# ls[[email protected] day03]# rm-rf var[[email protected] day03]# ls[[email  Protected] day03]# tar-xf log.tar.xz[[email protected] day03]# ls[[email protected] day03]# rm-rf var[[email  protected] day03]# LS III, Access CD and ISO image 1. Mount Mount device mount point (must be a directory) 2. Uninstall the Umount device Umount mount point 3. Optical drive devices under Linux/dev/sr0/dev/cdrom experiment: Accessing disc files 1. Insert the ISO file into the CD drive 2. Mount [[email protected] ~]# ls/mnt/dvd[[email  Protected] ~]# mkdir-p/mnt/dvd[[email protected] ~]# ls/mnt/dvd/[[email protected] ~]# mount/dev/cdrom/mnt /dvd/3. Accessing the disc contents [[Email protected] ~]# ls/mnt/dvd/4. Uninstall [[email protected] ~]# umount/mnt/dvd[[email  Protected] ~]# ls/mnt/dvd/

Linux Reference Note 4

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.