Linux environment deployment records (1) and linux environment deployment records

Source: Internet
Author: User

Linux environment deployment records (1) and linux environment deployment records

Time settings

View the current system date/time:

date -R

View the system hardware clock:

hwclock  --show

Set the hardware time:

hwclock --set --date="07/18/17 20:55"

Time Synchronization with hardware:

hwclock --hctosys

Time zone settings

tzselect

Select Asia-> China-> Beijing-> YES.

Port/firewall Problems

Check the usage of the specified port. take 80 as an example:

lsof -i:80

Enable the specified port. take 80 as an example:

/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/etc/init.d/iptables saveservice iptables restart

Disable the specified port. take 80 as an example:

/sbin/iptables -I INPUT -p tcp --dport 80 -j DROP/etc/init.d/iptables saveservice iptables restart

View port status:

/etc/init.d/iptables status

SCP

Scp transmission file (folder ):

scp root@192.168.1.2:/root/backup/1.txt /root/mydirscp -r root@192.168.1.2:/root/backup/dir /root/mydir

Change logon Password

Modify the logon password of the current user:

passwd

Tar command

Decompress the file to the current directory:

tar -zxvf /root/jdk.tar.gz

Compressing directories to files:

tar -zcvf /root/jdk.tar.gz /jdk

Software Installation

View the specified software installation path. Take mysql as an example:

rpm -ql mysql-server

Search for available software, using ssh as the Keyword:

yum search ssh

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.