Linux simple commands

Source: Internet
Author: User
System environment configuration: setup killxxxx (pid): change the current character set encoding: vi/etc/sysconfig/i18n to LANG & quot; zh_CN.GB2312 & quot; current path: pwd packaging: tar-zcvfSMStatistic_old_20110505.tar.gzSMStatistic Unzip: tar.

System environment configuration:

Setup

Kill process:

Kill xxxx (pid)

 

Change the current character set encoding:

Vi/etc/sysconfig/i18n

Change to LANG = "zh_CN.GB2312"

 

Current path:

Pwd

 

Packaging:

Tar-zcvf SMStatistic_old_20110505.tar.gz SMStatistic

Decompress:

Tar-zxvf com_20110321.tar.gz

Unzip xxx.zip

View:

Ll view file date

Delete files and subdirectories:

Rw-rf sss

View IO count:

Ls0f-p

 

View the current system Port:

Netstat

 

Firewall settings:

1. add a trusted port

In Linux, the firewall is called iptables, and the configuration file is in/etc/sysconfig. I performed the following operations in sequence:

# Vi/etc/sysconfig/iptables

Add:

The following content is the program code

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 2222-j ACCEPT

2. disable and enable:

1) takes effect after restart

Enable: chkconfig iptables on

Close: chkconfig iptables off

2) takes effect immediately and becomes invalid after restart

Enable: service iptables start

Disable: service iptables stop

 

 

Configure Lan:

Ifconfig eth0 192.168.0.1 netmask 255.255.255.0

Restart IP address:

/Etc/init. d/network restart

 

Lan graphical configuration interface:

Netconfig

 

Assign permissions to the installation file:

Chmod + x postgresql-8.4.3-1-linux-x64.bin

/Postgresql-8.4.3-1-linux-x64.bin

List opened files:

Lsof-I: 5432

View the linux version:

Cat/etc/issue

View linux hardware parameters:

Uname-

Upload files:

Rz

Download file:

Sz

Move or rename:

Mv

Create a file:

Mkdir

 

Search for keywords in the vi file:

Enter "/", and then enter the "keyword" you are searching"

 

Linux uninstall built-in JDK 1.4.2 installation jdk-1_5_0_06-linux-i586.bin

1. display the existing Java version of Linux:

# Java-version

Java version "1.4.2"

Gcj (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)

Copyright (C) 2004 Free Software Foundation, Inc.

 

2, I downloaded the new version is: jdk-1_5_0_06-linux-i586.bin

 

3. # sh jdk-1_5_0_06-linux-i586.bin select yes as prompted (installation complete)

 

4. delete the original JDK:

1) # alternatives -- remove jar/usr/bin/fastjar

2) # alternatives -- remove jar.1.gz/usr/share/man/man1/fastjar.1.gz

 

5. delete the original link:

# Cd/usr/bin

# Rm-rf java

# Rm-rf javac

 

6. create a soft link java under/usr/bin:

# Cd/usr/bin

# Ln-s jdk1.5.0 _ 06/bin/java/usr/bin/java

# Ln-s jdk1.5.0 _ 06/bin/javac/usr/bin/javac

 

7. to facilitate subsequent work, two soft links are also established under/usr/lcoal.

# Cd/usr/local/

# Ln-s jdk1.5.0 _ 06/usr/local/jdk

# Ln-s jdk1.5.0 _ 06/jre // usr/local/jre

 

8. Compile Environment variables

# Cd/etc

# Vi profile

# Set Environment by NetSeek (2009/2/19)

JAVA_HOME =/usr/local/jdk

JRE_HOME =/usr/local/jre

PATH = $ PATH: $ JAVA_HOME/bin: JRE_HOME/bin

CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib:

Export JAVA_HOME JRE_HOME PATH CLASSPATH

 

9. make the environment variable take effect:

# Source/etc/profile

# Java-version

Java version "1.5.0 _ 06"

Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 06-b05)

Java HotSpot (TM) Client VM (build 1.5.0 _ 06-b05, mixed mode, sharing)

We can see that the Java version has changed to 1.5.0 _ 06.

 

Linux software startup Directory

/Etc/init. d/

/Etc/init. d/postgresql-8.4 restart

View the current linux environment

Env

Download gcc

Yum-y install gcc

 

Java virtual machine:

JAVA_HOME =/usr/local/jdk1.6.0 _ 17

PATH = $ JAVA_HOME/bin: $ PATH

CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export JAVA_HOME

Export PATH

Export CLASSPATH

Source/etc/profile

Find the file and delete it.

Find com/-name '*. class'-exec rm {}\;

View port number

Netstat-an | grep

View mocache

Lsof-I 44441

 

Tar cvzf fw.tar.gz mas_dongguanyinghang/-- exclude = "*. log *"

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.