Linux Commands
Commands
ls
cd
mkdir
cat
more
head
tail
touch
rm
How To
Change Prompt

ls - linux command



ls command in linux


ls - is the list command in Linux Operating System. ls command will show the full list of files or entries of the directory. type ls and press the enter key in the terminal window. The file list will be displayed.


example

// type ls and press enter at putty/terminal prompt
freedomtutorials:~> ls

f5dafb78d19b64_ls.png

list with file size (human readable format)

 // type "ls -lh" and press enter at putty/terminal prompt
 ls -lh

Options:

optiondescription
-a, --alldisplay all files, not to ignore entries starting with . (dot / period) , in other words include hidden files in list.
-A, --almost-all display all file apart from . and ..
-l --authoruse this option with -l option to display author of each file.
-b, --escapedisplay octal escapes for nongraphic characters
-B, --ignore-backupsthis option will not list implied entries ending with ~
-cuse this option with -lt option to display to sort by ctime.
-Cdisplays entries by columns
-d, --directorydisplay directory entries instead of contents
-D, --direddisplay output designed for Emacs' dired mode
-fthis command will not sort entries and will enable -aU and disable -ls --color
-F, --classifywill append indicator (one of */=>@
-gsame as -l but will not list owner.
-G, --no-groupthis option will not include group name in display when using long listing option.
-h, --human-readablewhen using -l option, this option will display entries size in in human readable format eg 2K, 2M, 3G.
--siwhen using -l option, this option will display with powers of 1000 not 1024.
-i, --inodedisplays the index number of each file.
-I, --ignore=PATTERNwill not displays implied entries matching shell PATTERN
-kdisplays shell PATTERN like --block-size=1K
-ldisplays long listing format.
-L, --dereferencewhile showing file information for a symbolic link, display information for the file the link references rather than for the link itself
-mdisplays comma separated list of entries.
-n, --numeric-uid-giddisplays like -l, but displays list numeric user and group IDs.
-N, --literaldisplays raw entry names
-odisplays like -l, but will not displays group information
-p, --indicator-style=slash when listing directories this option append / indicator to directories
-q, --hide-control-charsdisplay ? instead of non graphic characters
-Q, --quote-namedisplay entry names in double quotes
-r, --reversedisplay reverse order while sorting
-R, --recursivedisplay sub-directories recursively
-s, --sizedisplay the allocated size of each file, in blocks
-tsort entries by modification time
-T, --tabsize=COLSdisplays tab stops at each COLS instead of 8 chars
-udisplays sort by access time
-Uthis option will not sort, displays entries in directory order
-vdisplays with version sort and numbers within text
-w, --width=COLSdisplays within screen width instead of current value
-xdisplays entries by lines instead of by columns
-Xdisplays by sorting alphabetically by entry extension
-1displays entries one file per line
ls --versiondisplays version of ls command and author information.

list only directories

 // type "ls -d */" and press enter at putty/terminal prompt
 ls -d */

display directory files with long list view

 // type "ls -l" and press enter at putty/terminal prompt
 ls -l

display directory files with long list view with sorting and human readable format

 // type "ls -lrth" and press enter at putty/terminal prompt
 ls -lrth


rm

rm command in linux

posted on 2019-10-24 21:34:18 - Linux Commands Tutorials


touch

touch command in linux

posted on 2019-10-23 19:41:20 - Linux Commands Tutorials


tail

tail command in linux

posted on 2019-10-23 19:10:42 - Linux Commands Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials