In: Computer Science
Please fill the following blank with a proper “option” so that the sizes of the files can be displayed in either K or M units as shown below.
$ ls –l –S -r ______________________ /bin | tail -2
-rwxr-xr-x 1 root root 998K 2017-05-16 bash
-rwxr-xr-x 1 root root 1.9M 2019-03-27 busybox
$
$ ls -l -S -r -h /bin tail-2
we put -h, for --human-readable
with -l and/or -s, print human readable sizes (e.g., 1K 234M
2G)
write the follwing command in linux terminal to see more information about ls command
output of the command is man ls is as bellow
$man ls
LS(1) User Commands LS(1)
NAME
ls - list directory
contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the
FILEs (the current directory by default). Sort entries
alphabetically if none of -cftuvSUX nor --sort
is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
--author
with -l, print the author of each file
-b, --escape
print C-style escapes for nongraphic characters
--block-size=SIZE
scale sizes by SIZE before printing them; e.g., '--block-size=M'
prints sizes in units of 1,048,576 bytes; see SIZE format
below
-B, --ignore-backups
do not list implied entries ending with ~
-c
with -lt: sort by, and show, ctime (time of last modification of
file status information); with -l: show ctime and sort by
name; otherwise: sort by ctime, newest first
-C list entries by columns
--color[=WHEN]
colorize the output; WHEN can be 'always' (default if omitted),
'auto', or 'never'; more info below
-d, --directory
list directories themselves, not their contents
-D, --dired
generate output designed for Emacs' dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify
append indicator (one of */=>@|) to entries
--file-type
likewise, except do not append '*'
--format=WORD
across -x, commas -m, horizontal -x, long -l, single-column -1,
verbose -l, vertical -C
--full-time
like -l --time-style=full-iso
-g like -l, but do not list owner
-C list entries by columns
--color[=WHEN]
colorize the output; WHEN can be 'always' (default if omitted),
'auto', or 'never'; more info below
-d, --directory
list directories themselves, not their contents
-D, --dired
generate output designed for Emacs' dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify
append indicator (one of */=>@|) to entries
--file-type
likewise, except do not append '*'
--format=WORD
across -x, commas -m, horizontal -x, long -l, single-column -1,
verbose -l, vertical -C
--full-time
like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files;
can be augmented with a --sort option, but any use of --sort=none (-U) disables grouping
-G, --no-group
in a long listing, don't print group names
-h, --human-readable
with -l and/or -s, print human readable sizes (e.g., 1K 234M
2G)
--si likewise, but use powers of 1000 not 1024
-H,
--dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
that points to a directory
--hide=PATTERN
do not list implied entries matching shell PATTERN (overridden by
-a or -A)
--hyperlink[=WHEN]
hyperlink file names; WHEN can be 'always' (default if omitted),
'auto', or 'never'
--indicator-style=WORD
append indicator with style WORD to entry names: none (default),
slash (-p), file-type (--file-type), classify (-F)
-i, --inode
Manual page ls(1) line 58/215 43% (press h for help or q to
quit)