Linux ls Command: List Files, Folders, and Hidden Files
HardReset.InfoJanuary 5, 20264 min8 views
5 connectionsΒ·6 entities in this videoβOpening the Terminal and Basic ls Command
- π» Open the terminal application to begin using Linux commands.
- π The
lscommand is used to list files and folders. - π By default,
lsin the home directory shows only folders. - β‘οΈ Use
cd /etcto navigate to a directory with more files and folders to demonstratelseffectively.
Advanced ls Command Options
- βΉοΈ The
lscommand can be enhanced with options to display more information. - π
ls -lprovides a long listing format, showing permissions, size, and modification timestamps. - π€«
ls -areveals hidden files and folders, which are typically prefixed with a dot (.). - ποΈ Combine options like
ls -lato see hidden files in a long format.
Enhancing ls Output Readability and Sorting
- π
ls -hdisplays file sizes in a human-readable format (e.g., KB, MB) when used with-l(e.g.,ls -lh). - βοΈ
ls -Ssorts files by size, with the largest files listed first. - π Combine options for a comprehensive view:
ls -lhSshows human-readable sizes, long format, and sorts by size. - π
ls -rreverses the sort order, displaying items from Z to A or smallest to largest if sorted by size.
Listing Only Directories
- π To list only directories, use the command
ls -d */. - π― This command specifically filters the output to show only directory entries.
Knowledge graph6 entities Β· 5 connections
How they connect
An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.
Hover Β· drag to explore
6 entities
Chapters2 moments
Key Moments
Transcript17 segments
Full Transcript
Topics13 themes
Whatβs Discussed
Linuxls commandTerminalList filesList foldersHidden filesFile permissionsFile sizeTimestampsHuman-readable sizesSort files by sizeReverse orderList directories
Smart Objects6 Β· 5 links
ProductΒ· 1
ConceptsΒ· 5