Linux压缩命令

本文介绍了Linux中的一些基本文件管理命令,如rm(删除)、mv(移动)、clear(清屏)以及uname(查看系统信息)。此外,还详细讲解了如何使用shutdown进行关机和重启操作。关于压缩,提到了zip和tar命令,包括如何压缩和解压缩文件,并给出了相关参数的使用示例。
摘要由CSDN通过智能技术生成

rm 删除

rm 文件 删除文件

rm -rf 删除目录

-r 递归

-f force 强制

rm -rf /

rm -rf /tmp/*

[root@localhost ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg  lxh
[root@localhost ~]# rm -rf lxh
[root@localhost ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg
[root@localhost ~]# 

mv 移动

[root@localhost ~]# touch x
[root@localhost ~]# mkdir h
[root@localhost ~]# mv x h
[root@localhost ~]# ls
anaconda-ks.cfg  h  initial-setup-ks.cfg
[root@localhost ~]# 

clear 清屏

ctrl+l 清屏 等价于clear

ctrl+c 中断当前命令

[root@localhost ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128 time=20.8 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=128 time=19.2 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=3 ttl=128 time=19.2 ms
^C
--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 19.262/19.792/20.841/0.750 ms
[root@localhost ~]# 

uname 查看系统信息

[root@localhost ~]# uname
Linux
[root@localhost ~]# 

uname -a 查看系统详细信息

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# 

uname -r 查看内核版本

[root@localhost ~]# uname -r
3.10.0-957.el7.x86_64
[root@localhost ~]# 

shutdown 关机

shutdown【参数】时间【警示信息】

-r reboot 重启

[root@localhost ~]# shutdown -r

- h halt 关机

[root@localhost ~]# shutdown -h

now 立即关机

[root@localhost ~]# shutdown -h now

hh:mm 小时:分钟

[root@localhost ~]# shutdown -r 10:30

eg:shutdown -h now  立即关机 等价于 poweroff

eg:shutdown -h hh:mm 指定时间关机

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值