Linux common commands (v)

Source: Internet
Author: User
Tags gpg yum repolist

Rights Management for Linuxthree basic permissions

R Read permission (read)

W Write permission (write)

X Execute permission (execute)

Permission Description

    

Format: Owner belongs to group others

1th bit: File type (d directory,-normal file, L link file)

第2-4位: The owning User (owner) permission, denoted by U (user)

第5-7位: The owning group permission, expressed in G (Group)

第8-10位: Other user (other people) permissions, denoted by O (other)

第2-10位: Represents all permissions, denoted by a (all)

Type: F binary file L Soft connect file D directory

Character

Permissions

The meaning of the file

The meaning of the directory

R

Read permissions

Can view the contents of a file

Can list contents of directory (LS)

W

Write permissions

Can modify the contents of a file

Delete files can be created in the directory (MKDIR,RM)

X

Execute permissions

Can execute file

Access to directory (CD)

Permission Change-chmod

English: Change mode (change the permissions mode of a file)

Role: Changing file or directory permissions

Grammar:

chmod [{ugoa}{+-=}{rwx}] [file name or directory]

chmod [mode=421] [file or directory]

Parameters:

-R The following files and subdirectories do the same permissions operation (recursive recursive)

Use numbers to represent permissions (r=4,w=2,x=1,-=0)

Example: chmod b.txt

RWX and digital representations can be switched freely

Note: Root is superuser, and root can be changed regardless of permissions. You cannot use an ordinary user to modify the permissions of another normal user.

Change owner-chown

English: Change file ownership

Role: Change the owner of a file or directory

Syntax: chown user[:group] File ...

-R: Recursive modification

Parameter format:

User: The user ID of the new file owner

Group: The user group of the new file owner (group)

Eg: #chown Lee File1 to change the owner of the file1 file to user Lee

Eg: #chown lee:test file1 to change the owner of the file1 file to user Lee, the owning group to test

Eg: #chown –R lee:test dir Modify the owner and owning group of Dir and its subdirectories

change the owning group Chgrp

English: Change file group ownership

Role: Change the owning group of a file or directory

Syntax: CHGRP [Group] file ...

EG:CHGRP root Test.log To change Test.log's owning group to root

RPM Package Management

The RPM package is also known as a binary software package. RPM is an abbreviation for the Redhat Package Manager (Redhat Packages management tool), a file format name that, although Redhat, is open-ended and now includes Redhat, CentOS, Versions of Linux, such as SuSE, are used and can be regarded as industry standards. RPM files are easiest to install on Linux systems

The rpm command uses

Common parameters for rpm

I: Installing the Application (install)

VH: Show installation progress; (verbose hash)

U: Upgrade package; (update)

QA: Show all installed packages (query all)

E: Uninstalling the application (erase)

Note: If the other packages have dependencies, the uninstallation will generate a prompt message and can be forcibly uninstalled using--nodeps.

Query all installed RPM packages: # RPM–QA

Query mysql-related packages: # Rpm–qa | grep MySQL

Installation: Rpm-ivh jdk.rpm

Uninstall: Rpm–e mysql*

Forcibly unloaded: Rpm–e mysql*--nodeps

Graphical interface, manual mount

Yum Management

Yellowdog Updater Modified Package management tools.

Benefits of applying Yum:
1, automatically resolve package dependencies
2, Convenient package upgrade
  Inquire

Yum list queries all available package lists

Yum Search keyword searches all and keyword-related packages on the server

You can find the package name by using the Yum info keyword

Installation

yum-y Install Package name -y auto Answer Yes

Upgrade

YUM-Y Update Package name

Note : If you do not add the package name, upgrade all, including the kernel. You must upgrade a single package with the name of the package and upgrade all of them with caution. detection upgrade Yum check-update

  Unloading

Yum-y Remove Package Name
  Help

Yum--help, man Yum

Yumclean all clears the cache and the old package

Yum Repolist View the currently available Yum sources

Yum deplist httpd lists a package for all dependent packages

build local Yum source

#cat/etc/yum.repos.d/centos-base.repo

[Base]

name=centos-$releasever-base

mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=os

#baseurl =http://mirror.centos.org/centos/$releasever/os/$basearch/

Gpgcheck=1

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Explain:

[Base] Container name, must be placed in []

Name Container description, this can be written on your own

Mirrorlist Mirror site, this can be commented out

BaseURL the address of the Yum source server. The default is the official CentOS Yum source server,

Enabled this container is not effective, if not write or write enable=1 are effective, written enable=0 is not effective

Gpgcheck If 1 means that the RPM digital certificate is in effect and if 0 does not take effect

Pggkey the public key file of the digital certificate save location without modification

Basic steps:

1, Mounting Discs

# Mkdir/mnt/cdrom

# Mount/dev/cdrom/mnt/cdrom

Unload Mount with Umount/mnt/cdrom

2 to invalidate the network Yum source file

cd/etc/yum.repos.d/

Rename. Repo. Repo.bak * #重命名所有的. Repo file

CP Centos-media.repo.bak Centos-media.repo #配置一个. Repo file

3 , modify the disc yum source file

VI Centos-media.repo

[C6-media]

name=centos-$releasever-media

Baseurl=file:///mnt/cdrom #这里的地址为自己光盘挂载地址 and comment out the non-existent address at the beginning of the line

# file:///media/cdrom/

# file:///media/cdrecorder/

Gpgcheck=1

Enabled=1 #把原来的0改为1 to get this yum source funding file in effect

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Use Yum repolist to view the currently available Yum sources

Yum Clean All

Yum Repolist

Linux common commands (v)

Related Article

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.