ubuntu-命令行备份文件

命令:CPIO
deepfuture@deepfuture-laptop:/tmp$ cpio --h
Usage: cpio [OPTION...] [destination-directory]
GNU `cpio' copies files to and from archives

Examples:
  # Copy files named in name-list to the archive
  cpio -o < name-list [> archive]
  # Extract files from the archive
  cpio -i [< archive]
  # Copy files named in name-list to destination-directory
  cpio -p destination-directory < name-list
例子:
deepfuture@deepfuture-laptop:~$ find /home -name *.pdf | cpio -o >/tmp/backup.cpio
29219 块
deepfuture@deepfuture-laptop:~$ cd /tmp
deepfuture@deepfuture-laptop:/tmp$ ls
backup.cpio         pulse-WeMJdStCy5rX                           scim-socket-frontend-deepfuture
keyring-Te1C2g      scim-bridge-0.3.0.socket-1000@localhost:0.0  seahorse-JS2wki
orbit-deepfuture    scim-helper-manager-socket-deepfuture        ssh-lHXiNP3054
pulse-PKdhtXMmr18n  scim-panel-socket:0-deepfuture               virtual-deepfuture.idDYLk
deepfuture@deepfuture-laptop:/tmp$ ls -a
.            .ICE-unix           pulse-WeMJdStCy5rX                           scim-socket-frontend-deepfuture  .X0-lock
..           keyring-Te1C2g      scim-bridge-0.3.0.socket-1000@localhost:0.0  seahorse-JS2wki                  .X11-unix
backup.cpio  orbit-deepfuture    scim-helper-manager-socket-deepfuture        ssh-lHXiNP3054
.esd-1000    pulse-PKdhtXMmr18n  scim-panel-socket:0-deepfuture               virtual-deepfuture.idDYLk
deepfuture@deepfuture-laptop:/tmp$ ls -l
总用量 14660
-rw-r--r-- 1 deepfuture deepfuture 14960128 2009-08-04 10:28 backup.cpio
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 08:30 keyring-Te1C2g
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 10:21 orbit-deepfuture
drwx------ 2 root       root           4096 2009-08-04 08:30 pulse-PKdhtXMmr18n
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 08:30 pulse-WeMJdStCy5rX
srwxr-xr-x 1 deepfuture deepfuture        0 2009-08-04 08:30 scim-bridge-0.3.0.socket-1000@localhost:0.0
srw------- 1 deepfuture deepfuture        0 2009-08-04 08:30 scim-helper-manager-socket-deepfuture
srw------- 1 deepfuture deepfuture        0 2009-08-04 08:30 scim-panel-socket:0-deepfuture
srw------- 1 deepfuture deepfuture        0 2009-08-04 08:30 scim-socket-frontend-deepfuture
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 08:30 seahorse-JS2wki
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 08:30 ssh-lHXiNP3054
drwx------ 2 deepfuture deepfuture     4096 2009-08-04 08:30 virtual-deepfuture.idDYLk
deepfuture@deepfuture-laptop:/tmp$ cpio -i <backup.cpio
cpio: 未创建 /home/deepfuture/MyDownloads/quickstart.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/distutils.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-regex.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/whatsnew.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/library.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/install.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-sockets.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/documenting.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-advocacy.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-doanddont.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/reference.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/using.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/c-api.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-webservers.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/extending.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-curses.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-unicode.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-cporting.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-urllib2.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/howto-functional.pdf:已有更新或同样新的版本存在
cpio: 未创建 /home/deepfuture/文档/docs-pdf/tutorial.pdf:已有更新或同样新的版本存在
29219 块

你可能感兴趣的:(socket,unix,ubuntu,ssh)