Listing the Current Directory
Runsls without any arguments to list the current directory:
sls displays files in a multi-column format, sorted alphabetically by name.
Listing a Specific Path
Provide a path as an argument to list that location:Relative Paths
You can use relative paths from your current location:Listing Multiple Paths
sls can list multiple directories in a single command. When listing multiple paths, each directory name is shown as a header:
Displaying Hidden Files
By default, hidden files (those starting with.) are not shown. Use the -a or --all flag:
One File Per Line
For easier parsing or readability, display each file on its own line:Long Format
The long format (-l or --long) displays detailed file attributes:
- Permissions - File mode (read, write, execute)
- Owner - File owner username
- Group - File group name
- Links - Number of hard links
- Size - File size in bytes
- Date - Last modification date
- Time - Last modification time
- Name - File or directory name
Combining Options
Options can be combined for more powerful output:Next Steps
Now that you understand basic usage, explore:- Options Reference - Complete list of all available flags
- Examples - Real-world usage scenarios