您的位置:首页 > 其它

124第十五章—远程连接、压缩和备份

2014-08-21 16:14 204 查看
⒈远程连接
使用ssh建立远程连接,ssh - openssh ssh client(remote login program)

常用格式:ssh [-l login_name][-p port][user@]hostname(ip)

不指定用户连接:ssh 192.168.1.6

指定用户连接:ssh root@192.168.1.6 ssh -l root 192.168.1.6
修改过ssh登录端口的连接: ssh -p 1234 192.168.1.6 ssh -p 1234 root@192.168.1.6
打开远端程序的图形化界面:ssh root@192.168.1.6 -X(xwindow,x协议)
建立连接的文件内容在家目录下的“.ssh”目录下。
ps:locale(查看编码)
⒉远程传输
①scp—secure copy (remote file copy program)
例子:scp 2.jpg root@192.168.1.13:/root/
②rsync—a fast,versatile,remote(and local)file-copying tool
例子:rsync 2.jpg root@192.168.1.13:/root/(-v:显示传输过程;-a:归档;-z:压缩)
ps:可以使用xftp在Windows和Linux平台之间进行传送
⒊打包
tar—GUN`tar`saves many files together into a single tape or disk archive and can restore individual files from the archive.
tar -cf archive.tar foo bar(--remove-files)
#create archive.tar from files foo and bar(并删除原文件)
tar -tvf archive.tar
#list all files in archive.tar verbosely
tar -xf archive.tar
#extract all files from archive.tar
tar -uf archive.tar files
#另外附加内容到archive.tar
⒋压缩、解压缩

①gzip:压缩后文件后缀为".gz",gzip files/gzip -d files(解压缩)

②bzip2:压缩后文件后缀为“.bz2",bzip2 files/bzip2 -d files(解压缩)
③zip:压缩后文件后缀为”.zip",zip .. .zip files/unzip .. .zip(解压缩)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  备份 压缩 远程连接