Linux下 文件的查找、复制、移动和解压缩

1、在/var/log目录下创建一个hehe.log的文件,其文件内容是:

myhostname = ghl

mydomain = localdomain

relayhost = [smtp.qq.com]:587

smtp_use_tls = yes

smtp_sasl_auth_enable = yes

smtp_sasl_security_options = noanonymous

smtp_sasl_tls_security_options = noanonymous

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

2、把hehe.log文件复制到/tmp目录下,并改名为haha.log

3、在/tmp目录下创建dirdir目录,把ls log 的输出保存到dirdir目录下的1.cfg文件中。并改名为new.cfg

4、在/var/log目录下查找.log后缀名的文件,并把输出保存到/tmp/log.txt文件中

5、用zip命令和tar命令将1-4题的new.cfg。log.txt。haha.log文件,压缩到/tmp目录

6、在/tmp目录下创建haha目录和xixi目录,将5题tar命令压缩的文件解压到haha目录。zip命令压缩的文件解压到xixi目录

相关推荐
緈福的街口15 分钟前
【leetcode】125.验证回文串
linux·算法·leetcode
Invinciblenuonuo33 分钟前
Linux【5】-----编译和烧写Linux系统镜像(RK3568)
linux·操作系统·rk3568·系统编译
T0uken1 小时前
【Linux】HAProxy:结合 WG 实现内网 TCP 反代
linux·运维·tcp/ip
鸢时望巧1 小时前
Shell循环(二)
运维·开发语言
wanhengidc1 小时前
大数据服务器和普通服务器之间的区别
大数据·运维·服务器
网硕互联的小客服1 小时前
如何诊断服务器硬盘故障?出现硬盘故障如何处理比较好?
大数据·运维·服务器
vortex51 小时前
Linux Shell 中的 dash 符号 “-”
linux·运维·服务器
月堂2 小时前
Linux操作系统-性能优化
linux·运维·服务器
鹏说大数据2 小时前
使用Conda管理服务器多版本Python环境的完整指南
服务器·python·conda
fictionist3 小时前
动态 Web 开发技术入门篇
java·服务器·开发语言·笔记·学习·mysql·spring