原创 awk的數組

1、創建一個test文件# cat test a   45b   12a   3b   4統計各個相同字母對應的數字和# awk '{A[$1]+=$2} END {for (i in A) print i , A[i]}' test a

原创 配置epel yum 源的方法

1、進入http://mirrors.yun-idc.com/網站,按如下目錄順序進入    epel--->6(我這裏是centos6版本的系統)--->x86_64(我是64爲的系統,所以進入這層目錄),到這層目錄,開始搜索epel-r

原创 rsync

一、以守護進程啓動rsyncd服務 1、啓動xinetd服務    # service xinetd restart    # vim /etc/xinetd.d/rsync    disable = yes改成disable = no二、

原创 find

1、在/root目錄下找到大於8126464字節的文件,然後移動到/opt/hhh目錄下# find /root -type f -size +8126464c | xargs -t -i mv {} /root/hhh/xargs:-i

原创 我的友情鏈接

51CTO博客開發gzmaster

原创 eval的用法

#!/bin/bashcd $(cd "$(dirname "$0")"; pwd)SAVEIFS=$IFSIFS=":"while read office ipdo        echo "$ip"        eval $offic

原创 ssh的一些參數

ssh -o ConnectTimeout=3 -o ConnectionAttempts=5 -o PasswordAuthentication=no -o StrictHostKeyChecking=no $ip  “command”1

原创 Only the first instance of IPTraf can configure或者IP Traffic Monitor already listening on eth0

經常用iptraf的人也許遇到這個問題,我是因爲經常需要運行iptraf在後臺,然後,而且,時不時要殺掉進程,導致的,其實,很好解決,只需要運行iptraf -f就好了;iptraf -h可以看到-f clear all locks a

原创 shell的if語句

文件表達式if [ -f  file ]    如果文件存在if [ -d ...   ]    如果目錄存在if [ -s file  ]    如果文件存在且非空if [ -r file  ]    如果文件存在且可讀if [ -w f

原创 python命令行下按tab建補全的方法

此方法只在centos6上測試通過,其它系統木有測試1、在用戶家目錄下創建一個名字叫 .pythonstartup 的隱藏文件,寫入如下內容:# python startup fileimport readlineimport rlcomp

原创 centos7將網卡名字改成eth樣式

1、打開/etc/sysconfig/grub,    # vim /etc/sysconfig/grub    內容如下:GRUB_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g'

原创 Permission denied You (root) are not allowed to access to (crontab) because of pam configuration.

第一步,查看/etc/pam.d/crond有如下一句account    required   pam_access.so第二步,查看/etc/security/access.conf有如下一句+ : root : cron crond

原创 rsync

一、以守護進程啓動rsyncd服務 1、啓動xinetd服務    # service xinetd restart    # vim /etc/xinetd.d/rsync    disable = yes改成disable = no二、

原创 linux上如何主指定的靜態路由永久有效

如何主指定的靜態路由永久有效:route add -net|-host/etc/sysconfig/network-scripts/route-ethN內容支持兩種定義的格式:1, NETWORK/NETMASK via GATEWAY2,

原创 讓html頁面自動刷新

<head>    <h1><p align="center">awstats nginx</p></h1>    <meta http-equiv="refresh" content="60">    </head>這裏的的meta這句就