摘要: #!/bin/bash #file name : filestat.sh if [ $# -ne 1 ]; then echo "Usage is $0 basepath"; exit fi path=$1 declare -A statarray; while read line; do ftype=`file -b "$line" | cut -d, -f1` ... 阅读全文
posted @ 2019-03-17 11:27 zhg1016 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Panel is deprecated and will be removed in a future version.The recommended way to represent these types of 3-dimensional data are with a MultiIndex o 阅读全文
posted @ 2019-03-15 22:01 zhg1016 阅读(15757) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash #查找并删除重复文件,每个文件只保留1份 ls -LS --time-style=long-iso | awk 'BEGIN { getline; getline; name1=$8; size=$5 } { name2=$8 if(size==$5) { "md5sum " 阅读全文
posted @ 2019-03-15 12:25 zhg1016 阅读(295) 评论(0) 推荐(0) 编辑
摘要: $ dd if=/dev/zero of=junk.data bs=1M count=1 参数: if (input file) of (output file) bs(block size) count(需要复制的块数) bs 单位(c w B K M G) /dev/zero 特殊的字符设备,返 阅读全文
posted @ 2019-03-15 11:58 zhg1016 阅读(1271) 评论(0) 推荐(0) 编辑
摘要: -exec 创建子shell $ find . -exec sh -c 'echo -n {} | tr -d "[:alnum:]_.\-" | \ tr "/" " "; basename {}' \; 文件汇总信息 for d in `find . -type d`; do echo `fin 阅读全文
posted @ 2019-03-15 11:45 zhg1016 阅读(557) 评论(0) 推荐(0) 编辑
摘要: rename #find path -type f -name "*.mp3" -exec mv { } target_dir \; #mp3 file mv dir_file #digui #find path -type f -exec rename 's/ /_/g' {} \; # 检查给的 阅读全文
posted @ 2019-03-14 22:56 zhg1016 阅读(286) 评论(0) 推荐(0) 编辑
摘要: rename find mv #实现查找png 和 jpeg文件 #!/bin/bash #file name: rename.sh #use: rename.jpg and .png files count=1; for img in `find . -iname '*.png' -o -inam 阅读全文
posted @ 2019-03-14 14:41 zhg1016 阅读(682) 评论(0) 推荐(0) 编辑
摘要: 1) sort file1.txt file2.txt > sorted.txt sort file1.txt file2.txt -o sorted.txt 2)sort -n file.txt #按照数字排序 3)sort -r file.txt #按照逆序排序 4)sort -M months 阅读全文
posted @ 2019-03-14 13:49 zhg1016 阅读(198) 评论(0) 推荐(0) 编辑
摘要: tr echo 12345 | tr '0-9' '9876543210' echo 87654 | tr '9876543210' '0-9' ROT13 echo "tr came, tr saw, tr conquered." | tr 'a-zA-Z' 'n-za-mN-ZA-M' echo 阅读全文
posted @ 2019-03-14 11:32 zhg1016 阅读(302) 评论(0) 推荐(0) 编辑
摘要: shebang = sharp-bang = #! 1.echo $PATH export PATH="$PATH:/home/user/bin" PREPEND prepend() { [ -d "$2" ] && eval $1=\"$2':'\$$1\" && export $1; } 2.e 阅读全文
posted @ 2019-03-13 11:48 zhg1016 阅读(155) 评论(0) 推荐(0) 编辑