linux中的基本命令

pwd :显示当前目录
ls :显示当前目录内容
cd : 目录切换
rm -rf 【路径】:删除文件夹
rm -f file :删除文件
ps -ef|grep smart:查看进程
kill -9 【进程id号】:杀死进程
chmod 777 test.sh:赋予文件权限(4 r /2 w/1 x)
vim 【可执行文件】:编辑器打开文件,i编辑,:wq保存并离开,!强制
cp 【文件】 【文件路径】:复制文件
telnet 【ip地址】 【端口号】:测试服务器端口是否开启
iptables的使用:
iptables -L -n 查看端口
cd /etc/sysconfig 
vim iptables 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8082 -j ACCEPT 开启8082端口
service iptables restart 重启iptables服务
df -hT 查看磁盘使用情况
fdisk -l 查看磁盘分区情况
fdisk /dev/sda 进入sda盘进行分区操作


1、将linux的时区设置为上海
#ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


2、设置全部时间
#date -s "12:12:23 2006-10-10″

猜你喜欢

转载自blog.csdn.net/y13g14m/article/details/79368096
今日推荐