Linux Common commands and tricks

Source: Internet
Author: User
Tags aliyun

View Release version
Cat/etc/redhat-releaselsb_release-a
Turn off the graphical interface
Init 3init5vi/etc/inittab
Configuring the Yum Source
Cd/etc/yum.repos.dll

Configure the Aliyun yum Source: Http://mirrors.aliyun.com/help/centos

Configure DNS
Vi/etc/resolv.confservice Network Restart
Configure the Network
Vi/etc/sysconfig/network-scripts/ifcfg-eth0service Network Restart
File compression and decompression tar.gz view tar.gz included files
TAR-TVF filename.tar.gz
Unzip to tar format
Gzip-d filename.tar.gz
Unzip to a file or directory
Tar xvf filename.tar.gz-c/usr/file
Compress files or directories as tar.gz
Tar cvfz test.tar.gz file1 file2
Tar view files included in tar
TAR-TVF Myfile.tar
Unzip to a file or directory
Tar xvf filename.tar-c/usr/file
Compress to tar.gz
Gzip Filename.tar
Compress a file or directory as tar
Tar cvf test.tar file1 file2
Zip to view the files contained in the zip
Unzip-l Filename.zip
Unzip the zip file or directory
Unzip filename.zip-d/usr/dile
Compress files or directories as zip
Zip-r test.zip file1 file2 dir1
View process and Port view service process
Ps-ef |grep Tomcat
viewing process ports
Netstat-anp|grep 23216
View Port Process
Lsof-i:80netstat-lnp|grep 80

Close process

Kill–9  23216
Switch User root switch to normal user
[email protected]/]# su username
Normal user switch root, enter the root password
[email protected]/]$ su

Linux Common commands and tricks

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.