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