If you just use the ls command without any options the output will be displayed in one line,
Example:code2care@mac ~ % ls
Desktop Downloads Movies Pictures
Documents Library Music Public
If you want the output to be displayed one entry per line, use -1 (number 1) optional parameter with the ls command.
Example on macOS terminal:code2care@mac ~ % ls -1
Desktop
Documents
Downloads
Library
Movies
Music
Pictures
Public
If you want to see more details about the directories and files you can make use of ls -l (lowercase letter l) command,
Example:code2care@mac ~ % ls -l
total 0
drwx------+ 5 code2care staff 160 Jan 10 14:10 Desktop
drwx------+ 3 code2care staff 96 Jan 2 23:03 Documents
drwx------+ 3 code2care staff 96 Jan 2 23:03 Downloads
drwx------@ 68 code2care staff 2176 Jan 6 20:29 Library
drwx------ 4 code2care staff 128 Jan 2 23:33 Movies
drwx------+ 6 code2care staff 192 Jan 5 22:37 Music
drwx------+ 4 code2care staff 128 Jan 2 23:28 Pictures
drwxr-xr-x+ 4 code2care staff 128 Jan 2 23:03 Public
More Posts related to Linux,
- Command to know the Available Memory on Linux System
- How to install curl on Alpine Linux
- How to backup a file in Linux/Unix
- Install Java Runtime Environment (Oracle or open JRE) on Ubuntu
- What is the Default Admin user and Password for Jenkins
- How to tar.gz a directory or folder Command
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: bash: ipconfig: command not found on Linux
- Command to check Last Login or Reboot History of Users and TTYs
- Linux: Create a New User and Password and Login Example
- ls command to list only directories
- bash: cls: command not found
- How to exit from nano command
- Installing and using unzip Command to unzip a zip file using Terminal
- What does apt-get update command does?
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to remove or uninstall Java from Ubuntu using apt-get
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- Sort ls command by last modified date and time
- Create Nested Directories using mkdir Command
- How to Exit a File in Terminal (Bash/Zsh)
- Command to know the installed Debian version?
- How to connect to SSH port other than default 22
- How to save a file in Nano Editor and Exit
- Install OpenSSL on Linux/Ubuntu
More Posts:
- How to remove/delete a directory in Linux/macOs - Linux
- Java -Day of the week using Java 8 DayOfWeek Enum - Java
- Android : Connection with adb was interrupted 0 attempts have been made to reconnect - Android
- How to send WhatsApp message from your Android App using Intent - WhatsApp
- How to Pretty Print cURL JSON Output in Terminal - cURL
- Where are screenshots saved on Windows 11 using Snipping Tool? - Windows-11
- Which Python version is bundled with macOS Sonoma 14 by default - MacOS
- [Fix] Instant java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Years - Java