To show the contents of a directory in the Linux terminal, you can use the
ls command, which stands for “list”:
This will display a list of all the files and directories in the current directory.
You can also specify a directory path as an argument to
ls to display the contents of a specific directory:
Additionally, you can use various options with the
ls command to modify its behavior. For example, to display file sizes and permissions in a long format, use the
To display all files, including hidden files (which start with a dot (for example .htaccess file)), use the
To sort the files by modification time (newest first), use the
There are many other options available for the
ls command, which you can explore by typing
man ls in the terminal to access the manual page.