List Files
Part of the Fundamentals section of Coddy's Terminal journey — lesson 5 of 82.
The ls command stands for list. It shows you all the files and folders inside your current directory.
Simply type ls and press Enter:
lsThe output will show everything in your current location:
documents
readme.txtUseful options you can add to <strong>ls</strong>:
ls -l — shows a detailed list with file sizes, permissions, and dates:
ls -lls -a — shows all files, including hidden files that start with a .:
ls -als -la — combines both options, showing a detailed list of all files including hidden ones:
ls -laYou can also list the contents of a specific folder by passing its name:
ls documentsThis shows the contents of the documents folder without having to navigate into it first.
Challenge
BeginnerUse the ls command to list all files and folders in your current directory.
Hint:
lstakes no arguments when listing the current directory — just type it and press Enter!
Cheat sheet
The ls command lists all files and folders in your current directory:
lsCommon options:
ls -l — shows detailed list with file sizes, permissions, and dates
ls -a — shows all files, including hidden files starting with .
ls -la — combines both options for detailed list of all files including hidden ones
To list contents of a specific folder without navigating to it:
ls documentsTry it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Directories
Create A DirectoryCopy A DirectoryMove And Rename A DirectoryDelete A DirectoryRecap - Directory Operations7File Content
Head And TailWord CountSort CommandUnique CommandGrep BasicsGrep With FlagsRecap - Text Detective2Navigation
Print Working DirectoryList FilesChange DirectoryAbsolute vs Relative PathsHome And Root DirectoryRecap - Find Your Way8Redirection
Standard OutputOverwrite To A FileAppend To A FileStandard InputStandard ErrorRecap - Log Builder6Wildcards And Patterns
The Star WildcardThe Question Mark WildcardBracket WildcardsCombining WildcardsRecap - Selective Operations9Piping
What Is A PipeChaining Two CommandsChaining Multiple CommandsPipe With GrepRecap - Data Pipeline