linux实用命令(1)
2014-07-20 17:37
211 查看
To copy, preserving permissions AND structure AND recursively,
from a remote system to your local system:
Please note that the code above assumes that you are using key based authentication and not password. For password based authentication, it would look more like this:
To remove all files matching a certain extension (xml
in my example) in a directory:
To go into a location, find all files that match a certain
extension (jpg in my example) and move them to a different directory:
To recursively remove empty directory from the directory
you are currently in (your pwd):
from a remote system to your local system:
1 | rsync -r -a -v -e ssh server1.address.com:/dir/youwant/to/copy/ /local/location/for/directory/ |
1 | rsync -r -a -v -e ssh remoteuser@server1.address.com:/dir/youwant/to/copy/ /local/location/for/directory/ |
in my example) in a directory:
1 | find . -type f -name "*.xml" -exec rm -f {} \; |
extension (jpg in my example) and move them to a different directory:
1 | find . -name "*.jpg" | xargs -i mv '{}' /location/to/move/them/to/ |
you are currently in (your pwd):
1 | find -depth -type d -empty -exec rmdir {} \; |
相关文章推荐
- linux//unix实用基本命令小全
- linux若干实用命令
- 实用技巧:Linux系统下VI命令快捷键集合(6)
- Linux实用命令
- linux下的实用配置命令
- Linux实用命令集合
- linux 实用命令
- 实用技巧:Linux系统下VI命令快捷键集合(8)
- 实用技巧:Linux系统下VI命令快捷键集合(9)
- Linux下tr命令“字符”处理的实用例子
- 小技巧: 实用的一行 Linux 命令
- 实用技巧:Linux系统下VI命令快捷键集合(13)
- 实用技巧:Linux系统下VI命令快捷键集合(14)
- 实用技巧:Linux系统下VI命令快捷键集合(7)
- 实用技巧:Linux系统下VI命令快捷键集合(10)
- linux/unix实用基本命令完整版
- 实用技巧:Linux系统下VI命令快捷键集合(15)
- 实用技巧:Linux系统下VI命令快捷键集合(11)
- 实用技巧:Linux系统下VI命令快捷键集合(4)
- Linux下tr命令“字符”处理的实用例子