bash字符串处理

  • 将movie目录下的文件名写到markdown文件中 , 再转html
rm index.md ; for f in `find .  *.* | sort`; do  [ -f $f ] && [ "${f%%/*}" = '.' ] && echo  '* ['`basename $f | sed 's/[//g; s/]//g'`']('"/movie/${f#*/}"')'   >> index.md ; done

pandoc --standalone --self-contained --css pandoc.css index.md -o index.html
  • 删除某进程
killall python
  • xargs
... | xargs -i  cp  {} destdir/
# mac 下不支持 -i
... | xargs -J {}  cp  {} destdir/
原文地址:https://www.cnblogs.com/bregman/p/11964254.html