Linux permissions, Disk Operations Command-linux Basic Environment Command Learning notes

Source: Internet
Author: User

1. Create users and user groups

1) Users and user groups

/ETC/PASSWD basic information for saving system users

/etc/group Saving User group information

User name: X:uid:gid

2) Basic Commands

Useradd adding users

Groupadd Adding user groups

passwd setting a password for a user

--echo ' 123456 ' | passwd--stdin User01 Echo Echoes

Su-user01 Switching users

ID User01 viewing user information

Userdel Deleting a user

Groupdel Deleting a user group

2. User Rights

chmod u-w,o+w/srv Modify permissions (comma separated by multiple actions)

U: User g: User group O: All Users

R: Read (4) W: Write (2) x: Execute (1)

chmod 734/srv 7=rwx 3=-wx 4=r--(default permissions directory 755, file 644)

Chown user01:root/srv Modify file owner: all groups

3, Package compression decompression

tar.gz

Compression: TAR-ZCVF compressed package name. tar.gz destination file path (V can not be added, T table view)

Decompression: TAR-ZXVF after compression registration. tar.gz [-C Specify directory]

tar.bz2

Compression: TAR-JCVF compressed package name. tar.bz2 destination file path (v not available)

Decompression: TAR-JXVF after compression registration. tar.bz2 [-C Specify directory]

Zip

Compression: Zip destination file path

Decompression: Unzip compression pack

4. Disk Management commands

1) Get disk information

Linux system default all device files under/dev, tertiary block hard disk/dev/sda/,/dev/sdb/,/DEV/SDC

Fdisk-l viewing system hard disk partition information

A. System total of several hard drives, capacity size

B. partition of each hard drive (if there are any remaining)

2) Partitioning

Fdisk/dev/sdb into partition operation

Partx-a/dev/sdb Reload Partition table

MKFS.EXT4/DEV/SDB6 Formatting Sdb6

File system: ext2 ext3 ext4 XFS

Mount/dev/sdb6/mnt mount the SDB6 to the MNT directory (temporarily active, restart invalid) umount Uninstall

Modify the/etc/fstab file to mount permanently

/dev/sdb6/mnt EXT4 Defaults 0 0

Df-h View Mount Info >> mount point is the only entry for this partition

5. Package

1). RPM Package

RPM-QA viewing installed packages, RPM-QA | grep to see if the installed package name

-IVH Installation

-e uninstall (without suffix)

-QF See which installation package is installed for a file

-QL viewing an installation package installs those files

2) Yum command-Manage RPM packages

Yum-list list all available RPM packages (including installed)

-Y Install Package name installation (-y do not need to ask)

-y Remove Package name unload

Configure the Yum warehouse warehouse configuration file path/ETC/YUM.REPOS.D

            

Linux permissions, Disk Operations Command-linux Basic Environment Command Learning notes

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.