CentOS Common Command Daquan

Source: Internet
Author: User
Tags yum repolist


CD ~ Switch to home directory
CD/TMP Switch to directory tmp
cd dir switch to dir directory in current directory
CD/Switch to root directory
Cd.. Switch to the previous level directory
Cd.. /.. Switch to the top level two directory
CD ~ Switch to User directory

New folder: mkdir filename
File Rename: MV Oldfilename newfilename
Move file: MV filename path (if multiple files, filename1/filename2)
Installing RPM:RPM-IVH filename
Update RPM:RPM-UVH filename
Unzip the TAR.GZ:TAR-ZCVF compressed file name. tar.gz Compressed file name
Compressed files: TAR-ZXCF compressed file name. tar.gz
Install software: Yum install software
View Source list: Yum repolist

To view the number of CPU bits: getconf long_bit
View kernel/Os/cpu information: uname-a
View CentOS Version: Cat/etc/redhat-release
Delete File: RM filename
Delete the directory and all the content it contains: Rm-rf directory
View crontab files: Cat/etc/crontab

View file content encoding: enca-l ZH_CN filename
File content encoding transcoding: iconv-f original code-t target encoding original file > target file
Enca-l current language-x target encoded file name
Enca-l zh_cn-x UTF-8 < file1 > file2 (if you do not want to overwrite the source file)
File name Encoding conversion: convmv-f original encoding-t target encoding--notest *.mp3 (-r This means recursive conversion of all subdirectories in the current directory)

View Java run: Ps-ef | grep java (ctrl + C stop)
View log: Tailf/tmp/skg_json_log

Using Vim to edit files: Vim filename
Enter INSERT:I
Exit insert using a different command: ESC
Reads the contents of a file and writes it to the current editor:: R filename
Write the contents of the editor to a new file:: W newfilename
Temporarily leave VI to command column mode to execute::! Cmd
Enter the shell command line, after executing the command ctril+d launch re-enter Vim continue to edit:: sh
Save the file but do not exit:: W
Force save, do not exit:: w!
Save the modified file to file without exiting the vi::w files
Exit does not save:: Q
Exit and Save: ZZ (: Wq)
Force Save and exit:: wq!
Forced exit does not save:: q!
Discard all changes, starting from the last save file and then edit:: e!

CentOS Common Command Daquan

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.