lsLists the visible files and folders in the current directory.
Lists directory contents with sizes, permissions, owners, timestamps and hidden files.
sudo apt install coreutilslsLists the visible files and folders in the current directory.
ls <path>Lists the contents of another directory without changing into it.
Example
ls /etcls -laLong listing of everything, including hidden dot-files: permissions, link count, owner, group, size and modification time.
Example
ls -la /home/alicels -lhLong listing with human-readable sizes (K, M, G) instead of bytes.
Example
ls -lh /var/logls -1Prints one name per line — handy when piping into other commands.
ls -d */Lists only the directories in the current folder.
ls -iShows inode numbers — useful for spotting hard links and deleting files with awkward names.
ls -lnShows numeric UIDs and GIDs instead of names — reveals files owned by deleted users.
ls -l --time-style=full-isoShows full timestamps with seconds and timezone, useful when building a forensic timeline.
ls -luShows (and with -t, sorts by) last access time instead of modification time.
ls -lR <path>Lists a directory tree recursively.
Example
ls -lR /opt/appls -la --color=autoColours files by type; most distributions alias ls to this already.
ls -la /rootChecks whether the root home directory is readable by your user — it should not be.
ls -l /etc/passwd /etc/shadowVerifies permissions on the account files: passwd should be 644, shadow 640 or stricter. A world-readable shadow is a serious finding.
ls -la /etc/cron*Lists cron directories and files to find scheduled jobs and check who can modify them.
The shell built-in that changes the current directory, including shortcuts for home, previous and parent directories.
Searches the directory tree by name, type, size, time, owner or permissions — and runs actions on matches.
Changes file permissions using symbolic or octal modes, including setuid, setgid and sticky bits.
Changes the owner and group of files and directories.
Prints the full path of the current working directory, optionally resolving symbolic links.