Linux stuff: Difference between revisions
From Mintarc Forge
No edit summary |
|||
Line 3: | Line 3: | ||
== ls - List directory contents == | == ls - List directory contents == | ||
The ls command is used to list files and directories in a specified location. It has many options to customize the output. | The ls command is used to list files and directories in a specified location. It has many options to customize the output. | ||
Examples: | Examples: | ||
ls -l: Long listing format, showing permissions, owner, size, and modification date | *ls -l: Long listing format, showing permissions, owner, size, and modification date | ||
ls -a: Show all files, including hidden ones (those starting with a dot) | *ls -a: Show all files, including hidden ones (those starting with a dot) | ||
ls -R: Recursively list subdirectories | *ls -R: Recursively list subdirectories | ||
ls -lh: Use human-readable file sizes (e.g., 1K, 234M, 2G) | *ls -lh: Use human-readable file sizes (e.g., 1K, 234M, 2G) | ||
ls /etc: List contents of the /etc directory | *ls /etc: List contents of the /etc directory |
Revision as of 14:10, 19 February 2025
Common Commands with examples
These commands and their usage are used for both the LinuC Level 1 Exam 101 and Exam 102. Using these commands in various scenarios to become proficient in basic command-line tasks, file management, and system administration.
ls - List directory contents
The ls command is used to list files and directories in a specified location. It has many options to customize the output.
Examples:
- ls -l: Long listing format, showing permissions, owner, size, and modification date
- ls -a: Show all files, including hidden ones (those starting with a dot)
- ls -R: Recursively list subdirectories
- ls -lh: Use human-readable file sizes (e.g., 1K, 234M, 2G)
- ls /etc: List contents of the /etc directory