RHCE——归档文件并在系统间复制文件
来源:互联网 发布:mac设置airdrop 编辑:程序博客网 时间:2024/05/21 19:45
管理压缩的tar存档
- c(创建存档)
- t (列出存档内容)
- x(提取存档文件)
- f(要操作的文件名)
- v(详细信息)
打包文件
[root@localhost text]# tar cfv file_1.tar file1 file2 file3file1file2file3[root@localhost text]# ll file_1.tar -rw-r--r--. 1 root root 10240 8月 1 01:19 file_1.tar
列出tar存档的内容
[root@localhost text]# tar tf file_1.tar file1file2file3
提取存档内容,加P可以同时保留文件权限
[root@localhost text]# tar xpf file_1.tar
创建tar压缩文件
- z 用于gzip压缩,文件后缀.tar.gz或.tgz
- j 用于bzip2压缩,文件后缀.tar.bz2
- J用于xz压缩,文件后缀.tar.xz
[root@localhost text]# tar zcf text1.tar.gz file1 file2[root@localhost text]# tar jcf text1.tar.bz2 file1 file2[root@localhost text]# tar Jcf text1.tar.xz file1 file2[root@localhost text]# ll-rw-r--r--. 1 root root 125 8月 1 01:34 text1.tar.bz2-rw-r--r--. 1 root root 124 8月 1 01:33 text1.tar.gz-rw-r--r--. 1 root root 172 8月 1 01:34 text1.tar.xz//解压[root@localhost text1]# tar zxf ../../text1.tar.gz [root@localhost text2]# tar jxf ../../text1.tar.bz2 [root@localhost text3]# tar Jxf ../../text1.tar.xz
在系统间安全地复制文件
使用scp协议,根据ssh进行加密传输
[root@localhost text]# scp root@120.24.222.231:~/hyt.tar .root@120.24.222.231's password: hyt.tar 100% 10KB 10.0KB/s 00:00 [root@localhost text]# scp text1.tar.bz2 root@120.24.222.231:~/root@120.24.222.231's password: text1.tar.bz2 100% 125 0.1KB/s 00:00
使用sftp远程传输文件
[root@localhost text]# sftp 120.24.222.231root@120.24.222.231's password: Connected to 120.24.222.231.sftp> mkdir sftpsftp> cd sftpsftp> put /etc/hohost.conf hosts hosts.allow hosts.deny sftp> put /etc/hostsUploading /etc/hosts to /root/sftp/hosts/etc/hosts 100% 158 0.2KB/s 00:00
[student@localhost 桌面]$ sftp root@120.24.222.231root@120.24.222.231's password: Connected to 120.24.222.231.sftp> get ~/aaFile "/root/~/aa" not found.sftp> get aaFetching /root/aa to aa/root/aa 100% 20 0.0KB/s 00:00 sftp> exit
rsync在系统间安全的同步文件
方法和scp类似
[student@localhost 桌面]$ rsync -av /var/log/messages /tmpsending incremental file listrsync: send_files failed to open "/var/log/messages": Permission denied (13)sent 49 bytes received 31 bytes 160.00 bytes/sectotal size is 111427 speedup is 1392.84rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9][student@localhost 桌面]$ rsync -av /var/log/messages root@120.24.222.231:/tmproot@120.24.222.231's password: sending incremental file listrsync: send_files failed to open "/var/log/messages": Permission denied (13)sent 49 bytes received 31 bytes 12.31 bytes/sectotal size is 112130 speedup is 1401.62rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]
阅读全文
0 0
- RHCE——归档文件并在系统间复制文件
- RHEL十一(归档文件并在系统间复制文件)
- 1-12tar归档 文件并在系统间复制文件
- 在归档模式下删除非系统文件的恢复
- 使用Java复制文件并在控制台显示文件进度
- 读取并复制文件
- 使用vi打开编辑多个文件并在多个文件间复制粘贴内容
- 开归档并设置归档文件存储路径
- linux——文件归档及文件传输
- postgresql归档失败并在日志文件中存在报错
- Java读取并复制文件
- 【dd】转换并复制文件
- 批量复制文件并改名
- RHCE——使用访问控制列表(ACL)控制对文件的访问
- 文件读写,归档,反归档
- 调用系统对话框复制文件
- 用系统函数复制文件
- C++系统调用复制文件
- 记录一次解决PHP返回数据被nginx截断的问题
- 统计下边这个长字符串中各个字符出现的次数并找到小甲鱼送给大家的一句话
- 完全二叉树的特点
- bugku Web4
- angularJS中显示数据-合并行
- RHCE——归档文件并在系统间复制文件
- Redis新集群操作(在已有的集群上添加新节点)
- 键盘鼠标模拟全知道
- 转载:Nginx部署CodeIgniter的转发配置
- 杭电oj1108 最小公倍数 参考之前的文章1019
- Ubuntu——命令行下清除回收站
- [CTF]zip伪加密
- of表示动宾关系
- 图像处理21:Otsu's二值化