9d05fee96d0e156208a05883e7551150 linux bash1 v1 rasb14 2019-01-25 17:19:33 v3.1.3 (2018-09-13)
Generated 2019-01-25 18:19:33 by dbwebb lab-utility v3.1.3 (2018-09-13).
A lab where you use Unix commands to list, find, and change the directory structure.
The entire lab uses the apache2 configuration directory from ‘/etc/apache2’ in linux installations.
In this section we use the ls command to list files in the directory structure.
Use the command ls to list the files and directories in the apache2 directory, list one file/directory per line.
Tip: Use the command man ls to see the flags that can be used for the ls command.
Use the command ls to list the files and directories in the apache2 directory. Use a flag so every directory gets a slash (/) after the name, list one file/directory per line.
Tip: Use the command man ls to see the flags that can be used for the ls command.
First change directory to apache2/mods-available and use the ls command to list the files in the directory.
List only files beginning with ‘a’ and have the file extension ‘.conf’. List one file per line.
You can use && to chain two or more commands on the same line.
Tip: Use a wildcard * to match against more than one file.
List all, even hidden, files and directories in the apache2/sites-available directory. List one file/directory per line.
In this section we use the cp, mv, mkdir and rm to change in the directory structure.
Use the mkdir command to create a directory called backup/ if the directory does not exist.
Copy all files with the file extension .conf from apache2/mods-available to a new directory backup/conf/, create the directory if it does not exist.
List all the files in the new directory backup/conf/, sort the files according to file size, with the biggest file first. List one file per line.
Tip: Use && to execute more than one command and man mkdir to find the correct flag.
Use the mkdir command to create a new subdirectory backup/php/ if it does not exist.
Use the mv command to move all files beginning with ‘php’ from backup/conf/ to the new directory.
List the files in the backup/conf/ directory. List one file per line.
Remove all files the begins with ‘proxy’ from backup/conf/.
List the files in the backup/conf/ directory. List one file per line.
In this section we use the find to find files and directories in a directory structure.
In this section you work with the original directory apache2/.
Use the find command to find the apache2.conf file in the apache2/ directory.
Use the find command to find all empty files in the apache2/ directory.
Use the find command to find all directories which have ‘conf’ in the file name in the apache2/ directory.
Search only in the apache2/ directory and not in the subdirectories.
Solve these optional questions to earn extra points.
List files and directories in apache2/conf-available, sort the files in file size order with the smallest file first.
List one file per line.
Do not show hidden files.
Use the cp command to copy all files from the backup/php/ directory to the backup/ directory.
Remove the entire backup/php/ directory.
List files and directories in the backup/ directory, use a flag so that all directories gets a slash (/) at the end of the file name. List one file per line.
Use the find command to find all files which contain ‘ssl’ in the name and has the file extension ‘.conf’.
Search only in the apache2/sites-available and apache2/mods-available directories.
9d05fee96d0e156208a05883e7551150