Linux,使用sed删除空格
删除开头空格 sed 's/^ *//g' test.txt >new.txt 删除行首空格 sed 's/^[ \t]*//g' 删除行尾空格 sed 's/[ \t]*$//g' »
删除开头空格 sed 's/^ *//g' test.txt >new.txt 删除行首空格 sed 's/^[ \t]*//g' 删除行尾空格 sed 's/[ \t]*$//g' »
删除 >>> 之前的 sed 's/>>>/\n/;s/.*\n//' test.txt >new.txt »
查明登陆端口 who root pts/1 Feb 3 01:16 (192.168.1.58) root pts/2 Feb 3 05:28 (192.168.1.60) 通知该用户将要关闭他: echo "I will close your connection »
wget -r -p -np -k http://baidu.com/ -r 递归 -p --page-requisites -np --no-parent -k 下载的HTML页面中的链接转换为相对链接即本地链接 »
mysqldump -h192.168.1.222 -ubackup -pbackup kds trank | gzip > $backupdir/back.sql.gz »
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; 允许局域网内192.168.访问 GRANT ALL PRIVILEGES ON *.* TO 'root'@' »
参数 --prefix rpm -ivh --prefix=/usr/local/dir/ rpmfile**.rpm »
sync && echo 3 > /proc/sys/vm/drop_caches »
eg. 删除/root/Backup目录下30天前的文件 find /root/Backup -mtime +30 -name "*.*" -exec rm -rf {} \; »
kill -9 `ps -aef | grep 'qoute' | grep -v grep | awk '{print $2}'` »