菜单

关闭
  • Home
  • Java
  • Clojure
  • Python
  • Linux
订阅
菜单

Shell Tips

共 41 篇文章

← 上一页 第 4 页 ⁄ 共 5 页 下一页 →

Shell,使用sed或awk过滤字符

eg. 过滤clean之后的字符 sed 's/\(.*clean\).*/\1/' file.txt awk -F 'clean' '{print $1""FS}' file.txt »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Shell,在文件的每行开头添加关键字

sed 's/^/keyword/' oldfile.txt >newfile.txt »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Shell,使用wget和curl断点续传下载

wget -c curl -C curl -C - #自动续传 eg. wget -c http://baidu.com/ curl -C curl -C - http://baidu.com/ wget -t 0 反复尝试的次数,0为不限次数 -O »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Linux,shell脚本mysql的使用

#!/bin/sh mysql -uroot -p123456 <use test; select * from test where a=10000; »

Grizzly 标签:Linux, MySQL, Shell Tips 2016年02月03日

Shell,find 与rm 结合使用

find /home/mq/ -name 'test-*' | xargs rm -rf »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Shell,find 与cp 结合使用

find /home/mq/ -name '*.conf'|xargs -I {} cp -r {} /home/mq/conf/ »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Linux,使用sed删除包含关键字的行

sed -i -e '/\/home\/this\//!d' file.txt »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Linux,使用grep取出包含关键字的行并保存到新的文件中

grep "keyword" oldfile.txt> newfile.txt »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Shell,使用sed过滤反斜杠

sed -r 's:\\::g' oldfile.txt >newfile.txt »

Grizzly 标签:Linux, Shell Tips 2016年02月03日

Shell,根据进程pid结束该进程

#!/bin/sh PIDFILE=/tmp/app.pid echo 'Kill process from PID file' if test -f $PIDFILE ; then PID=`cat $PIDFILE` kill -3 $PID »

Grizzly 标签:Linux, Shell Tips 2016年02月03日
← 上一页 第 4 页 ⁄ 共 5 页 下一页 →
C'est la vie © 2016
Proudly published with Ghost & GhostChina