Linux Basic Collection

Source: Internet
Author: User
Tags gz file

Ifconfig eth0 192.168.1.223

Switch to root account
Start is $ sign
Input Su
Enter the root password
Convert to # becomes the root account

Dr View Drive letter
ls/etc/View the files under the ETC folder
ls/bin/View the files under the Bin folder

LS corresponds to List
Ls-a query All files A is all
Ls-l query file shows all Properties L is a long
LS-LH Query file displays all properties (property file size is calculated automatically)

File type-binary file d directory l soft link file
File permissions U owner g belongs to group O other person a everyone
R Read W write X Execute

MKDIR-P Create folder P recursive creation
PWD the detailed path to the folder
. This level of directory: Parent Directory
RmDir Delete Empty directory internal empty folder or file can not be deleted
CP copy-r copy directory-p reserved file properties
MV Cut folder to other folder modify file name
RM-RF Delete folder F Force Delete r folder F Force Delete
====================================
Touch creates two files by creating a file space
Cat view File Content-N line number
TAC upside down view file contents
More spaces, f page, enter line break Q exit
Less view the contents of the file can be pageup up the page, the upper arrow up the line can command/Direct search n Next continue search keyword highlighting
Head-n rows View the first n rows of a file, the first 10 rows are viewed by default when n is not written
Tail-n rows View the last n rows of a file, without writing n, view the last 10 rows by default-F dynamically displays the end of the file
============================================
Ln-s Create soft links without S is hard link
A soft link is a shortcut inside windows that can span partitions
Hard link is the original file backup, is the same I node, synchronous update, when the file deletion, hard links as can be used, hard links must be in the same partition, cannot create a hard link to the directory
=============================================
chmod Modify the permissions of the file-R (modify all files and all child files and directories permissions, only the owner or root has permission to change permissions) + Add permissions-delete permissions = that permission, regardless of the previous permissions
R 4 W 2 x 1
Files: can view the contents of the file can modify the contents of the file (modified, but not deleted) can execute the file (script scripts, commands)
Directory: You can list the contents of the directory can be created in the directory, delete files can enter the directory (directory permissions, generally will have RX, can see access, it is impossible to see can not enter)
Whether a file can be deleted, not whether the file itself has write permission, but whether the folder has write permissions
==============================================
Chown Modify the owner of the file, only the root permission has this permission
Chown User Files
CHGRP modify all groups of files
Umark-s Display the default permissions for the settings file-s to display the file's default permissions as Rwx
If there's no S, then Mister 022, that's 777-022=755 is rwxrw-rw-
===============================================
Find search files
Find/etc-name init find files with the name init in the ETC folder
Fuzzy search with wildcard characters Find/etc-name *init*
Find/etc-name Init??? Match the ETC folder with the name below the 3-character file after Init
Find/etc-iname init Search by file name, file name case not distinguished
================================================
Locate find files in the file repository, very fast, but if the newly created files are not included, so long can not be queried to
UpdateDB re-update the file repository
Which view the path and alias of a command
Whereis find absolute paths and help documents for commands
grep content Lookup inside a file-I case-insensitive-V exclusion lookup
================================================
Man LS view Help documentation for LS
Man command name to view the Help document for the command
Man Services view the Help documentation for the Services configuration file (the absolute path to the configuration file does not require a write profile, which is directly the profile name)
Help Umask view shell built-in commands umask
Whatis ls A simple help document for viewing commands
===============================================
Useradd Hognda Add User Hongda
passwd Hongda Set password for user Hongda
Who View server remote login user Information TTY local terminal pts Remote Terminal
W View detailed login user information
Uptime to see if the server has been contacted for uptime (measure server stability)
===============================================
. zip is a compression mode that both Windows and Linux can use
gzip file in GZ format compression (only the file can be compressed, if it is a directory, it will be ignored, can not compress the directory) (after compression will not have the original file, compression does not retain the original file)
Gunzip or gzip-d the GZ file
TAR-C Packaging
-V Detailed information
-F Specify File name
TAR-CVF Japan.tar Japan packages The Japan catalogue and packs them into Japan.tar
Tar-z compression when packaged
TAR-ZCF Japan.tar.gz Japan Package compression for Japan Catalog
Tar-x Unpacking
TAR-ZXVF Japan.tar.gz to Japan unpacking
Zip japan.zip Japan zip compression (smaller compression ratio, also can compress the directory)
Unzip Test.zip Decompression
Bzip2 Zip Premium compression is relatively high,-K retains the original file. bz2
Bzip2-k test to compress the test file and keep the original file
Bunzip2 Extract-K reserved Compression pack
. tar.bz2 TAR-CJF-XJF
=====================================
Shutdown-h now shuts down (shutdown can save the service and data correctly)
Shutdown-r now reboot
=====================================
There are two main types of packages under the Linux system
Source package, you can view the source code, generally C language, installation is relatively slow, the efficiency is about 5% high.
Binary package, RPM package, system default package, cannot open, install faster, have been compiled, have dependencies, must install the required package
RPM packages are highly dependent and must be installed at the first level of the packages that depend on them.
Installation package RPM-IVH Package full name I (install) installation v display details H show progress
Uninstall Package RPM-E Package name (the package is now installed so that it can be identified as long as the package name)
Yum does not have to be on the Internet, Yum manages RPM packages, the difference is that RPM commands are installed manually, Yum is automatically installing RPM packages

Linux Basic Collection

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.