Man: to provide online help
such as: #man ls
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
mkdir: Creating an empty Directory
such as: mkdir file
RmDir: Delete Empty directory
such as: RmDir file
RM: Deleting files
-RF forced recursive deletion
such as: rm-rm/home/user/
CP: Copy command
-A recursive copy directory equivalent to-DR
-V Display procedure
such as: Cp-a/etc/home/user-v
Cat: View Files
such as: Cat 123.txt
Example: Cat 123.txt 456.txt>7.txt (merge files)
MV: Move renaming file
such as: MV 123.txt/home/user/
PWD: Displays the current directory path
Locate: Find file or directory commands
Locate find assistance for naming dependent UpdateDB , schedule tasks to execute daily CRONTAB-E
4 * * * updatedb
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
Date: Show set Date command
Example: Change time is September 29 10:23
Date 09291023
Clock: Displays the full date time
Tar: Unzip command
such as: tar-zxvf/home/file.tar.gz
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 *
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
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
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