Linux Getting Started note 3

Source: Internet
Author: User

I. Administrative authority and attribution
1. Overview of permissions
Document attribution
Owner (U): The user who owns this file/directory-user
Owning Group (g): The group that owns this file/directory-group
Other users (O): Users other than the owner, the owning group-other
Access rights
Read (R): Allow viewing of content-read
Write (W): Allow content to be modified-write
Executable (x): Allow to run and switch-excute
2. View Permissions Ls-l
Ls-l/etc/passwd
-|rw-|r--|r--. 1 root root 2481 February 09:37/etc/passwd
①②③④⑤⑥⑦⑧⑨⑩
Permission reading order: ⑩①⑥②⑦③④
① File types

  • File
    Catalog D
    L Link
    ② Owner's permissions
    R = 4 Read
    W = 2 Write
    x = 1 Executable
  • No
    ③ permissions of the owning group
    R = 4 Read
    W = 2 Write
    x = 1 Executable
  • None
    ④ permissions for other users
    R = 4 Read
    W = 2 Write
    x = 1 executable
  • None
    ⑤ number of links
    Files: Links
    Directory: How many subdirectories (...) are in this directory.
    ⑥ owner
    ⑦ the owning group
    ⑧ file size
    ⑨ file creation time
    ⑩ File/directory name
    Change file Attribution
    Chown Master: File/directory Change file/directory owner
    Chown: Group file/directory change file/directory Owning group
    Chown: Genus group File/directory Change file/directory owner and owning group
    -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/studir
    [[email protected] ~]# chown root:root/ tmp/studir/
    [[email protected] ~]# ls-ld/tmp/studir
    1. 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

Second, backup and recovery

    1. Make/Release Zip package
      A. Compress 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/opt
B. Unzip
Format: Unzip backup file. zip [-D destination Folder]
Format: Unzip backup file. zip

eg
[Email protected] ~]# Ls/tmp/todir
[Email protected] ~]# unzip-d/tmp/todir/opt/boot_bak.zip
[Email protected] ~]# Ls/tmp/todir
2. Make/release. Tar Package
A. Make a. Tar package and compress
Basic usage
Format: TAR-ZCPF backup file. 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/log/
[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. Unzip the. Tar Package
Basic usage
Format: TAR-XPF backup file. tar.gz
Format: tar-xf backup file. 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

Third, access to the CD and ISO image
1. Mounting
Mount device mount point (must be a directory)

2. Uninstall
Umount Equipment
Umount mount point

Optical drive device under 3.Linux
/dev/sr0
/dev/cdrom

Experiment: Accessing a disc file
1. Insert the disc
Put the ISO file into the optical drive
2. Mounting
[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 CD Contents
[Email protected] ~]# ls/mnt/dvd/
4. Uninstall
[Email protected] ~]# Umount/mnt/dvd
[Email protected] ~]# ls/mnt/dvd/

Linux Getting Started note 3

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.