Basic Linux Operations

Source: Internet
Author: User

1. Linux environment variable (source/etc/profile immediate effect)

/etc/profile This file sets environment variables for each user of the system, and when the user first logs on, the file is executed and the shell settings are collected from the configuration file of the/ETC/PROFILE.D directory.

/etc/environment sets the environment for the entire system, and/etc/profile is the setting for all users, regardless of login, which is related to login

/ETC/BASHRC executes this file for each user running the bash shell, and the file is read when the bash Shell is opened

~/.bash_profile Each user can use this file to enter shell information dedicated to their own use, when the user logs on, the file is only executed once, by default, he sets some environment variables,

Executes the user's. bashrc file

~/.BASHRC The file contains bash information dedicated to your bash shell, which is read when you log in, and every time you open a new shell.

2. Linux Firewall

Chkconfig iptables on/off after reboot

Immediate effect Service Iptables Start/stop

Modify/etc/sysconfig/iptables

-A rh-firewall-1-input-m State--state NEW

-M TCP--dport 80-j ACCEPT

3. View Port

Netstat

-T display TCP port

-U UDP port

-L Show only listening sockets

-P Process

-N does not perform DNS, display IP

NETSTAT-NTLP View all current TCP ports

Netstat-ntulp | grep 80 View all 80 port usage

Netstat-an | grep 3306 View 3306 port usage

  

Basic Linux Operations

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.