-
Notifications
You must be signed in to change notification settings - Fork 0
/
lscmd
executable file
·115 lines (113 loc) · 7.27 KB
/
lscmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
HELP=0;
OPT='';
PATTERN="^--?[^ ]+$";
for O in "$@"; do
if [[ "$O" =~ $PATTERN ]]; then
if [[ "$O" == --help ]]; then
HELP=1;
fi;
OPT="$OPT $O";
fi;
done;
if [[ $HELP -eq 0 ]]; then
cd ~/bin;
ls $OPT $(find -L * -maxdepth 0 -type f -executable);
else
exec 1>&2;
echo "Usage: $(basename $0) [OPTION]...";
echo "List information about available custom commands";
echo "Sort entries alphabetically if none of -cftuvSU nor --sort is specified.";
echo "";
echo " --author with -l, print the author of each file";
echo " -b, --escape print C-style escapes for nongraphic characters";
echo " --block-size=SIZE scale sizes by SIZE before printing them; e.g.,";
echo " '--block-size=M' prints sizes in units of";
echo " 1,048,576 bytes; see SIZE format below";
echo " -c with -lt: sort by, and show, ctime (time of last";
echo " modification of file status information);";
echo " with -l: show ctime and sort by name;";
echo " otherwise: sort by ctime, newest first";
echo " -C list entries by columns";
echo " --color[=WHEN] colorize the output; WHEN can be 'always' (default";
echo " if omitted), 'auto', or 'never'; more info below";
echo " -D, --dired generate output designed for Emacs' dired mode";
echo " -f do not sort, enable -U, disable -ls --color";
echo " -F, --classify append indicator (one of *@) to entries";
echo " --file-type likewise, except do not append '*'";
echo " --format=WORD across -x, commas -m, horizontal -x, long -l,";
echo " single-column -1, verbose -l, vertical -C";
echo " --full-time like -l --time-style=full-iso";
echo " -g like -l, but do not list owner";
echo " -G, --no-group in a long listing, don't print group names";
echo " -h, --human-readable with -l and/or -s, print human readable sizes";
echo " (e.g., 1K 234M 2G)";
echo " --si likewise, but use powers of 1000 not 1024";
echo " -H, --dereference-command-line";
echo " follow symbolic links listed on the command line";
echo " --hide=PATTERN do not list implied entries matching shell PATTERN";
echo " --hyperlink[=WHEN] hyperlink command names; WHEN can be 'always'";
echo " (default if omitted), 'auto', or 'never'";
echo " --indicator-style=WORD append indicator with style WORD to entry names:";
echo " none (default), file-type (--file-type),";
echo " classify (-F)";
echo " -i, --inode print the index number of each command";
echo " -I, --ignore=PATTERN do not list implied entries matching shell PATTERN";
echo " -k, --kibibytes default to 1024-byte blocks for disk usage";
echo " -l use a long listing format";
echo " -L, --dereference when showing command information for a symbolic";
echo " link, show information for the command the link";
echo " references rather than for the link itself";
echo " -m fill width with a comma separated list of entries";
echo " -n, --numeric-uid-gid like -l, but list numeric user and group IDs";
echo " -N, --literal print entry names without quoting";
echo " -o like -l, but do not list group information";
echo " -q, --hide-control-chars print ? instead of nongraphic characters";
echo " --show-control-chars show nongraphic characters as-is (the default,";
echo " unless program is 'lscmd' and output is a terminal)";
echo " -Q, --quote-name enclose entry names in double quotes";
echo " --quoting-style=WORD use quoting style WORD for entry names:";
echo " literal, locale, shell, shell-always,";
echo " shell-escape, shell-escape-always, c, escape";
echo " -r, --reverse reverse order while sorting";
echo " -s, --size print the allocated size of each command, in blocks";
echo " -S sort by command size, largest first";
echo " --sort=WORD sort by WORD instead of name: none (-U), size (-S),";
echo " time (-t), version (-v)";
echo " --time=WORD with -l, show time as WORD instead of default";
echo " modification time: atime or access or use (-u);";
echo " ctime or status (-c); also use specified time";
echo " as sort key if --sort=time (newest first)";
echo " --time-style=STYLE with -l, show times using style STYLE:";
echo " full-iso, long-iso, iso, locale, or +FORMAT;";
echo " FORMAT is interpreted like in 'date'; if FORMAT";
echo " is FORMAT1<newline>FORMAT2, then FORMAT1 applies";
echo " to non-recent files and FORMAT2 to recent files;";
echo " if STYLE is prefixed with 'posix-', STYLE";
echo " takes effect only outside the POSIX locale";
echo " -t sort by modification time, newest first";
echo " -T, --tabsize=COLS assume tab stops at each COLS instead of 8";
echo " -u with -lt: sort by, and show, access time;";
echo " with -l: show access time and sort by name;";
echo " otherwise: sort by access time, newest first";
echo " -U do not sort; list commands in directory order";
echo " -v natural sort of (version) numbers within text";
echo " -w, --width=COLS set output width to COLS. 0 means no limit";
echo " -x list entries by lines instead of by columns";
echo " -Z, --context print any security context of each command";
echo " -1 list one command per line. Avoid '\n' with -q or -b";
echo " --help display this help and exit";
echo " --version output version information and exit";
echo "";
echo "The SIZE argument is an integer and optional unit (example: 10K is 10*1024).";
echo "Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).";
echo "";
echo "Using color to distinguish file types is disabled both by default and";
echo "with --color=never. With --color=auto, ls emits color codes only when";
echo "standard output is connected to a terminal. The LS_COLORS environment";
echo "variable can change the settings. Use the dircolors command to set it.";
echo "";
echo "Exit status:";
echo " 0 if OK,";
echo " 2 if serious trouble (e.g., cannot access command-line argument).";
fi;