In this hands-on lab, we will practice moving through directories and listing files. Becoming comfortable changing directories, and listing files is a necessary step in moving through a Linux file system.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Determine Which File Is the Oldest
- To list the directory and sort by date, we use
-l
for "long listing",-A
for "almost all", and-t
for "sort by time".ls -lAt ~/Practice/Test/var/log/
- To list the directory and sort by date, we use
- Determine Which File Is the Largest
- To list the directory and sort by file size, we use
-l
("long listing") and-S
("sort by file size").ls -lS ~/Practice/Test/var/log/
- To list the directory and sort by file size, we use
- Determine When the File `~/Practice/Test/sos_commands/networking/netstat_-W_-neopa` Was Last Modified
- We use a simple
-l
for "long listing" to view the last modified time and date.ls -l ~/Practice/Test/sos_commands/networking/netstat_-W_-neopa
- We use a simple
- Determine When the File `~/Practice/Test/sos_commands/networking/netstat_-W_-neopa` Was Last Accessed
- To view access times, we use
-l ("long listing") and
-u` (access time).ls -lu ~/Practice/Test/sos_commands/networking/netstat_-W_-neopa
- To view access times, we use