Linux Common commands Summary--keep adding

Source: Internet
Author: User

Let's start with a very useful command: history looks at the historical commands on the Linux machine.

View memory under Linux We generally use the free command: free-m

View hard disk Status: Df-h

View CPU Information: Less/proc/cpuinfo View CPU Cores: Less/proc/cpuinfo |grep ' model name '-C your Linux host character set (LANG): env | grep LANG

View Process: Ps–ef | grep MySQL

Kill process: Kill-9 port number

viewing ports: Netstat-ano | grep 3306

View folder size, and sort: Du-sh * | Sort-n

Effective after a firewall restart
Open: Chkconfig iptables on
OFF: Chkconfig iptables off

Firewall is in immediate effect and fails after reboot
Open: Service iptables start
Close: Service iptables stop

Create folder: mkdir log

Create file: Touchlog

Removal directory: Rm-rf/usr/lib64/mysql

Remove RM Log from File

Copying files: cp/mu/mu1

Copy directory: Cp-r one

Switch directory: CD

View file contents: Cat

Vim three modes: Command mode, insert mode, edit mode. Use ESC or I or: to toggle the mode.

: Q exit

: q! Force exit

: Wq Save and exit

Query Find/-name mysqlfind/-iname "*.CNF"-print Display Date: Date

LS Display file or directory

-l list File details L (list)

-a lists all files and directories under the current directory, including Hidden A (all)

Output Tomcat Run log
Tail-f/tomcat/logs/cataline.out

Xshell

SZ filename Download file

Linux Common commands Summary--keep adding

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.