symlinks2.sh

来自「Shall高级编程」· Shell 代码 · 共 21 行

SH
21
字号
#!/bin/bash# symlinks.sh: Lists symbolic links in a directory.OUTFILE=symlinks.list                         # save filedirectory=${1-`pwd`}#  Defaults to current working directory,#+ if not otherwise specified.echo "symbolic links in directory \"$directory\"" > "$OUTFILE"echo "---------------------------" >> "$OUTFILE"for file in "$( find $directory -type l )"    # -type l = symbolic linksdo  echo "$file"done | sort >> "$OUTFILE"                     # stdout of loop#           ^^^^^^^^^^^^^                       redirected to save file.exit 0

⌨️ 快捷键说明

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