Prerequisite commands for Linux system Management

Source: Internet
Author: User
Tags delete key gpg install perl

  1. Man: to provide online help

    such as: #man ls

  2. ls: Show directory contents

    -a displays all files in the current directory

    -L Show Permissions/owner/size/date of all files

    -S shows the space used for each file

    Example: Ls-la-s-S | More

  3. mkdir: Creating an empty Directory

    such as: mkdir file

  4. RmDir: Delete Empty directory

    such as: RmDir file

  5. RM: Deleting files

    -RF forced recursive deletion

    such as: rm-rm/home/user/

  6. CP: Copy command

    -A recursive copy directory equivalent to-DR

    -V Display procedure

    such as: Cp-a/etc/home/user-v

  7. Cat: View Files

    such as: Cat 123.txt

    Example: Cat 123.txt 456.txt>7.txt (merge files)

  8. MV: Move renaming file

    such as: MV 123.txt/home/user/

  9. PWD: Displays the current directory path

  10. Locate: Find file or directory commands

    Locate find assistance for naming dependent UpdateDB , schedule tasks to execute daily CRONTAB-E

    4 * * * updatedb

  11. Find: Search for files in the directory

    find/root/data/-type F Find by file type

    find/root/data/-type f-exec rm-f {} \; and Reason

    find/root/data/-type F|xargs Rm-f and joining pipeline processing

    find/data/-type F! -name "4.txt" |xargs rm-f except 4.txt external processing

    Example: 1. Find 123.txt in the entire directory

    Find/-nmae 123.txt

    2. Find out if the/home directory is a "test" user's file

    Find/home-user Test

    3. Find the file with the permission "600" in the/home directory

    Find/home-perm 600

    4. Find more than 1MB files in the/home directory

    Find/home-size +1024k (or 1M)

    -type Search by file type F denotes normal document D directory! Take counter

    -name "file name" Search by file name

  12. Date: Show set Date command

    Example: Change time is September 29 10:23

    Date 09291023

  13. Clock: Displays the full date time

  14. Tar: Unzip command

    such as: tar-zxvf/home/file.tar.gz

  15. Zip: Press House command

    1. Compress all txt,jpg in the data directory to File.zip

    [Email protected] data]# Zip myfile *.txt *.jpg

    2. Compress all files contained under the data directory to File.zip

    [Email protected] data]# zip-r myfile *

  16. Unzip: Extract command

    1. Unzip the Myfile.zip file

    [[email protected] data] #unzip Myfile.zip

    2. Extract the Myfile.zip file to the newly created directory new

    [[email protected] data] #unzip myfile.zip-d new

  17. RPM: Software Installation

    1. Installation package

    RPM-IVH 123.rpm

    2. Deleting a package

    Rpm-e 123.rpm

    3. Upgrade Package

    RPM-UVH 123.RPM

    4. Query Package

    Rpm-q 123

  18. Yum detailed

    I. Enumerating package files

    List all RPM packages that can be installed or updated in the repository

    # Yum List


    Lists the specific RPM packages that can be installed or updated and installed in the repository

    # Yum List Perl//List of packages named Perl

    # Yum List perl*//list the packages at the beginning of Perl


    List all RPM packages that can be updated in the repository


    # Yum List Updates

    List all RPM packages that have been installed


    # Yum List installed

    List RPM packages that have been installed but are not included in the repository


    # Yum List Extras

    Note: Extras is the name of the resource list defined in REPOS.D


    Ii. enumeration of resource information

    List all the RPM packages that can be installed or updated in the repository

    # Yum Info


    Lists the specific information in the repository that can be installed or updated and the RPM packages that have been installed

    # Yum Info perl//List Perl package information

    # Yum Info perl*//List all packages at the beginning of Perl information


    List information about all RPM packages that can be updated in the repository

    # Yum Info Updates


    List all the RPM packages that have been installed

    # Yum Info installed


    Lists information about the RPM packages that have been installed but are not included in the repository

    # Yum Info Extras


    Third, search

    Search for RPM packages that match specific characters

    # Yum Search Perl/searching in Package name, package description, etc.


    Search for RPM packages with a specific file name

    # YUM provides realplay


    Iv. Management Pack

    Installing RPM Packages

    # yum Install Perl//Installation Perl package

    # yum Install perl*//install Perl at the beginning of the package


    Remove RPM packages, including packages that are dependent on the package

    # yum Remove perl*//will remove all perl-* packages


    Five, update

    Check for updatable RPM packages

    # yum Check-update


    Update all RPM Packages

    # Yum Update


    Update specified RPM packages, such as update kernel and kernel source

    # Yum Update kernel Kernel-source


    A large-scale version upgrade, unlike Yum Update, even the old obsolete package is upgraded

    # Yum Upgrade


    Six, empty the cache

    Clear the Staging RPM package file

    # Yum Clean Packages


    Purge the RPM header files in the staging

    # Yum Clearn headers


    Clear the old RPM header files in the staging

    # Yum Clean oldheaders


    Purge old RPM header files and package files in staging

    # Yum Clearn

    Or

    # Yum Clearn All


    Vii. Other

    Install livna.org RPMs GPG key

    # RPM--import Http://rpm.livna.org/RPM-LIVNA-GPG-KEY


    Check GPG Key

    # Rpm-qa gpg-pubkey*


    Display key Information

    # Rpm-qi Gpg-pubkey-a109b1ec-3f6e28d5


    Delete key

    # RPM-E Gpg-pubkey-a109b1ec-3f6e28d5

This article is from the "Airsky Learning Linux" blog, so be sure to keep this source http://airsky.blog.51cto.com/969074/1785543

Prerequisite commands for Linux system Management

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.