一、磁盘使用情况

两个命令df 、du结合比较直观
df    -h                      #查看整台服务器的硬盘使用情况

du   -sh    *                 #查看每个文件夹的大小

二、tar 用法

压缩 tar
tar -czvf test.tar.gz   a.c     #压缩 a.c文件为test.tar.gz

三、端口是否被占用

netstat -anp |grep 6001

四、修正时间

修正linux的时间:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
查看时间: date "+%Y-%m-%d %H:%M:%S"、
查看时区: date "+%Z"
同步工作时间
 yum install -y ntpdate
 ntpdate 0.asia.pool.ntp.org
    - [x]   time.nist.gov
    - [x]   time.nuri.net
    - [x]   0.asia.pool.ntp.org
    - [x]   1.asia.pool.ntp.org
    - [x]   2.asia.pool.ntp.org
    - [x]   3.asia.pool.ntp.org
最后执行如下命令将系统时间同步到硬件,防止系统重启后时间被还原
hwclock --systohc

五、新版本linux更新hostname的方法

hostnamectl set-hostname host001

六、md 转换成 doc

pandoc下载链接
pandoc -s test.md -o test.docx

七、echo用法

echo覆盖写入文件,追加写入文件

##覆盖    
echo  “” >文件名

##追加   
echo “”  >>文件名
posted on 2022-03-18 17:36  妖皇  阅读(115)  评论(0编辑  收藏  举报