2018年1月23日

(shell)Show all the files in folders and subfolders

摘要: for d in ./*; do if [ -d "$d" ]; then for e in $d/*;do if [ -d "$e" ]; then find "$e" -type f -print fi done fi done for d in ./*; do if [ -d "$d" ... 阅读全文

posted @ 2018-01-23 17:12 cdekelon 阅读(185) 评论(0) 推荐(0) 编辑

(shell)show all the folders and sub-folders

摘要: # cat bbb-subfolder.sh for d in ./*; do if [ -d "$d" ]; then echo "$d" for e in $d/*;do if [ -d "$e" ]; then echo "$e" fi done fi done 阅读全文

posted @ 2018-01-23 16:46 cdekelon 阅读(192) 评论(0) 推荐(0) 编辑

(shell)show all the files in one path

摘要: # cat aaa-ls.sh yourfilenames=`ls ./*.jpg` for eachfile in $yourfilenames do echo $eachfile done 阅读全文

posted @ 2018-01-23 16:27 cdekelon 阅读(140) 评论(0) 推荐(0) 编辑

os.remove some jpgs

摘要: >>> import os >>> for i in range(1,23): ... os.remove(str(i)+'.jpg') ... ... 阅读全文

posted @ 2018-01-23 15:11 cdekelon 阅读(95) 评论(0) 推荐(0) 编辑

shutil.rmtree, os.path, delete sub-folders, format

摘要: #==== #This script will check how many files in sub-folders. #Will delete the sub-folders if the files are not enough. #==== import os import shutil from os import walk import os.path #mypath='./' ... 阅读全文

posted @ 2018-01-23 14:19 cdekelon 阅读(141) 评论(0) 推荐(0) 编辑

导航