bigfiles.sh

来自「seismic software,very useful」· Shell 代码 · 共 32 行

SH
32
字号
#! /bin/sh# bigfiles - show large files in current tree# Usage: bigfiles [size]# Jack K. Cohen, 1988## Note: all this damn ___MARKER_FILE stuff is because if find comes up#      ls will list everything in the current directory!#      /etc/skulker on PS/2 might show a better way.PATH=/bin:/usr/bincmd=`basename $0`tmp=___MARKER_FILE# Arrange to remove tmp at shell termination (0) or signal# Internal trap to ignore 0 is to avoid double remove in case of signaltrap "rm -f $tmp; trap '' 0; exit 1" 0 1 2 3 15touch ___MARKER_FILEcase $# in0)	(find . -type f -size +1000 -print ; echo ___MARKER_FILE) | xargs ls -s;;1)	(find . -type f -size +$1 -print ; echo ___MARKER_FILE) | xargs ls -s;;*)	echo "$cmd [size_in_blocks]" 1>&2 ; exit 1esac(find . -type d -size +5 -print ; echo ___MARKER_FILE) | xargs ls -ldrm ___MARKER_FILE

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?