ls Command

List directory contents
ls command gives information about the files (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Basic Usage:
ls -l

Examples:
ls -l
Show informations of file and folders in directory.
It shows owner, grub, file size, last changing time infos.

ls -al
Show informations of file and folders in directory with hidden files.
It shows owner, grub, file size, last changing time infos.

ls --block-size=M -l
--block-size=SIZE parameter sets output which depends giving SIZE and shows output.
K, M, G, T, P, E, Z, Y(as 1024) or KB, MB, GB, TB, PB, EB, ZB, YB (as 1000) uses with -l parameter.
Above command sets file size as 1024*1024 and shows output.

ls -H
-H or --dereference-command-line parameter, follows symbolic links listed on the command line.

ls --hide=aaa
--hide=PATTERN parameter, does not list implied entries matching shell PATTERN (overridden by -a or -A)
aaa file can't shown at output.

ls -i
-i or --inode parameter shows index number of each file.

ls -I aaa
-I PATTERN or --ignore=PATTERN, doesn't list implied entries matching shell PATTERN
aaa folder in current path can't shown at output.

ls -L
-L or --dereference show information for the file the link references for symbolic links.

ls -r
-r or --reverse parameter reverses order while sorting.

ls -R
-R or --recursive parameter lists subdirectories recursively .

ls --sort=size
Sort by size instead of name: none -U, extension -X, size -S, time -t, version -v

ls -1
List one file per line.

ls --help
Display help.

ls --version
Display output version information.



Above process applied on "GNU bash, version 4.3.11(1)-release (i686-pc-linux-gnu)"
Date of Article: 29.02.2016




HOME GNU/LINUX Commands TURKISH