Tag Archives : Linux

Linux命令tar压缩排除指定目录的方法

例如我要压缩 /cat/backup 这个文件夹 (绝对路径),但是不将里面的图片文件夹img也压缩了.可以用tar命令的--exclude 排除掉.方法

tar -zcvf backup.tar.gz --exclude=/cat/backup/img  /cat/backup

排除多个目录

tar -zcvf backup.tar.gz --exclude=/cat/backup/img --exclude=/cat/backup/a --exclude=/cat/backup/b /cat/backup
Filed in: Linux
0

iptables限制同一IP连接数

最近无聊人太多了,一直拿我的小博客来压力测试,所以不得不限制同一个IP的连接数,用iptables就可以简单设置了...

  iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 10 -j DROP

限制单个地址并发连接数不大于10

Filed in: Linux
3

Linux下替换文件名中的空格

find . -type f -name "* *" -print |
while read name; do
na=$(echo $name | tr ' ' '_')
if [[ $name != $na ]]; then
mv "$name" $na
fi
done
Filed in: Linux
0

linux修改ssh端口和禁止root远程登陆设置

linux修改ssh端口22

vi /etc/ssh/sshd_config

找到#port 22
将前面的#去掉,然后修改端口 port 1234
重启服务就OK了
service sshd restart

Read more...

Filed in: Linux
5

使用WinSCP连接到Linux

(1)winscp简介

通过WinSCP可以编辑、删除VPS上的文件,和上传文件到VPS。
与FTP不同的是,FTP通过会限制在某一目录中,而使用root通过WinSCP登录后则可以操作系统中的所有文件。

WinSCP的不足之处在于,WinSCP使用SFTP协议进行连接,而通过该连接的通信内容全部是经过加密的,在保证了安全的同时,也降低了传输速度。
所以,通常在FTP操作不了的情况下,才需要使用WinSCP。

(2)安装winscp

首先需要下载该软件。可以到官方网站(http://winscp.net/eng/download.php)通过下载链接下载,也可以直接通过下面的链接进行下载。

http://cdnetworks-kr-1.dl.sourceforge.net/project/winscp/WinSCP/4.2.8/winscp428setup.exe

下载后运行安装程序开始安装。文中未提到的设置均默认即可。

Read more...

Filed in: Linux
3

在Linux系统centos 上安装7-ZIP

刚刚才在centos上安装了RAR, 现在又要在centos上安装7-ZIP,真烦,还好安装步骤都简单:

wget http://nchc.dl.sourceforge.net/sourceforge/p7zip/p7zip_4.65_src_all.tar.bz2
tar -xjvf p7zip_4.65_src_all.tar.bz2
cd p7zip_4.65
make
make install

Read more...

Filed in: Linux
11
© 2007-2010 猫言猫语. All rights reserved. Powered by WordPress. 5 queries in 0.068 seconds.
Proudly designed by Theme Junkie.