Archive — Ls

When working in the terminal, it's essential to have a solid grasp of basic commands to navigate and manage your files efficiently. Two commands that can help you achieve this are ls and creating an archive . Let's dive into how you can use these commands to keep your files organized.

An archive is a collection of files and directories that are stored together for easier distribution or backup. You can create an archive using commands like tar on Unix-based systems.

To view the contents of an archive file (like .tar , .tar.gz , .zip , .rar ), you must use archive-specific tools, plain ls .

tar -xzf archive.tar.gz ls -l extracted_folder/

The ls command is used to list the files and directories in your current location. By default, it displays the files and directories in a straightforward list. However, you can customize its output with various options. For example: