How to solve these challenges:


Challenge #1

  1. Move into the current user’s home directory using the cd command.

  2. List the contents of /etc using the ls command and an absolute path.

  3. Display the contents of /var/log/dmesg using the cat command and an absolute path.

  4. Move into the root directory (/) using an absolute path.

  5. List the contents of /etc using the ls command and an absolute path.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #2

  1. Move into the current user’s home directory using the cd command and an absolute path.

  2. List the contents of the current directory using the ls command and a relative path.

  3. List the contents of /home using the ls command and an absolute path.

  4. List the contents of /home using the ls command and a relative path.

  5. List the contents of /etc using the ls command and an absolute path.

  6. List the contents of /etc using the ls command and a relative path.

  7. Display the contents of /var/log/dmesg using the cat command and an absolute path.

  8. Display the contents of /var/log/dmesg using the cat command and a relative path.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #3

  1. Move into the root directory (/) using the cd command and an absolute path.

  2. Display the contents of /var/log/boot.log using the cat command and a relative path.

  3. Run the previous command as root.

  4. Move to /var/log directory using an absolute path.

  5. Display the contents of the Desktop directory using both an absolute and relative path.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #4

  1. Display the man page of ls and search for -d option.

  2. Display the contents of /var/log using a long listing format.

  3. Display information about the /var/log directory in long listing format.

  4. Display the contents of /etc on a single column.

  5. Display all files and directories (including hidden ones) from the user's home directory.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #5

  1. Display the contents of /var/log sorted by size in human readable format.

  2. Rerun the previous command adding an option that omits the files that ends in .log from listing.

  3. List the contents of /etc recursively.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #6

  1. Create a new file called linux.txt in the user’s home directory using the touch command.

  2. Notice the file timestamps using both stat and ls commands.

  3. Display the entire timestamp of the file using the ls command.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #7

  1. Consider the file created in the previous challenge. Notice its timestamps and then update them to the system current date and time.

  2. Change only the modification and change time to the current system time. See the change.

  3. Change only the modification time manually to 1990, January 15, 10:30:55 AM.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #8

Consider the file called linux.txt created in the previous challenge. Notice its timestamps and then update them to the values of /etc/passwd. See the changes.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #9

List the contents of /var/log displaying the access time of the files and sorting by file names in reverse order.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #10

Notice and try to recognize all Linux file types by running ls -l, ls -F and file commands.

Run the commands on the following files:

/etc/passwd

/var

/vmlinuz

/usr/bin/ls

/dev/sda1

/dev/tty1

/run/initctl

/run/snapd.socket

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #11

List the contents of /var/log/dmesg using the cat command and displaying the line numbers as well.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #12

  1. Display the contents of /etc/ssh/ssh_config page by page using less.

  2. Go to the end and then to the beginning of the file using the right shortcuts.

  3. Search forward for the string Ciphers

  4. Quit less

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #13

  1. Display the first 3 lines of /etc/passwd

  2. Display the last 5 lines of /etc/shadow

  3. Display the contents of /etc/group starting with line 5

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #14

  1. Display the last 12 lines of /var/log/auth.log in real-time.

  2. Become root in another terminal and notice how the display is automatically updated.

Are you stuck? Do you want to see the solution for this challenge? Click here.


Challenge #15

  1. Display the contents of the user’s home directory repeatedly every 2 seconds.

  2. Create a new file in the user's home directory and notice the differences between the refreshes.

Are you stuck? Do you want to see the solution for this challenge? Click here.