checks for layout

This commit is contained in:
waldek 2021-04-10 14:15:38 +02:00
parent 468810eb86
commit b41b64c46b
1 changed files with 111 additions and 111 deletions

View File

@ -79,24 +79,24 @@
1. There is one command in the table above that doesnt have a man page. Which one is it and why do you think that the command doesnt have a man page? 1. There is one command in the table above that doesnt have a man page. Which one is it and why do you think that the command doesnt have a man page?
1. Using the commands in the table above, create the following file tree. The names that start with a capital are Directories and the ones in lower case are files. 1. Using the commands in the table above, create the following file tree. The names that start with a capital are Directories and the ones in lower case are files.
``` ```
User User
├── Documents ├── Documents
| ├──Hello | ├──Hello
| | ├──hey2 | | ├──hey2
| | ├──helloa | | ├──helloa
| | └──ola5 | | └──ola5
| └──World | └──World
| └──earth9 | └──earth9
├── Downloads ├── Downloads
| ├──Music | ├──Music
| └──Songs | └──Songs
| ├──collection1 | ├──collection1
| └──collection2 | └──collection2
├── Test ├── Test
| └── passa | └── passa
└── test └── test
``` ```
1. Display on the screen the present working directory, including the subfolders. 1. Display on the screen the present working directory, including the subfolders.
1. Search within the tree for all files that end with a number. 1. Search within the tree for all files that end with a number.
1. Remove the entire directory tree with a single command. 1. Remove the entire directory tree with a single command.
@ -112,35 +112,35 @@ User
* docs * docs
* / * /
1. Observe the following file structure. Note: Directories end with a slash (/) when tree is invoked with the -F option. You will need elevated privileges in order to run the tree command on the root (/) directory. The following is example output and is not indicative of a full directory structure. Use it to answer the following questions: 1. Observe the following file structure. Note: Directories end with a slash (/) when tree is invoked with the -F option. You will need elevated privileges in order to run the tree command on the root (/) directory. The following is example output and is not indicative of a full directory structure. Use it to answer the following questions:
``` ```
$ sudo tree -F / $ sudo tree -F /
/ /
├── etc/ ├── etc/
│ ├── network/ │ ├── network/
│ │ └── interfaces │ │ └── interfaces
│ ├── systemd/ │ ├── systemd/
│ │ ├── resolved.conf │ │ ├── resolved.conf
│ │ ├── system/ │ │ ├── system/
│ │ ├── system.conf │ │ ├── system.conf
│ │ ├── user/ │ │ ├── user/
│ │ └── user.conf │ │ └── user.conf
│ └── udev/ │ └── udev/
│ ├── rules.d/ │ ├── rules.d/
│ └── udev.conf │ └── udev.conf
└── home/ └── home/
├── lost+found/ ├── lost+found/
└── user/ └── user/
└── Documents/ └── Documents/
12 directories, 5 files 12 directories, 5 files
``` ```
* A user enters the following commands: * A user enters the following commands:
``` ```
$ cd /etc/udev $ cd /etc/udev
$ ls -a $ ls -a
``` ```
* What will be the output of the ls -a command? * What will be the output of the ls -a command?
1. Enter the shortest possible command for each of the following: 1. Enter the shortest possible command for each of the following:
* Your current location is root (/). Enter the command to navigate to lost+found within the home directory (example): * Your current location is root (/). Enter the command to navigate to lost+found within the home directory (example):
@ -148,23 +148,23 @@ $ ls -a
* Your current location is /home/user/Documents/. Navigate to the directory named /etc/. * Your current location is /home/user/Documents/. Navigate to the directory named /etc/.
* Your current location is /etc/systemd/system/. Navigate to the directory named /home/user/. * Your current location is /etc/systemd/system/. Navigate to the directory named /home/user/.
1. Consider the following commands: 1. Consider the following commands:
``` ```
$ pwd $ pwd
/etc/udev/rules.d /etc/udev/rules.d
$ cd ../../systemd/user $ cd ../../systemd/user
$ cd .. $ cd ..
$ pwd $ pwd
``` ```
* What is the output of the final pwd command? * What is the output of the final pwd command?
## Explorational Exercises ## Explorational Exercises
1. Suppose a user has entered the following commands: 1. Suppose a user has entered the following commands:
``` ```
$ mkdir "this is a test" $ mkdir "this is a test"
$ ls $ ls
this is a test this is a test
``` ```
* What cd command would allow you to enter this directory? * What cd command would allow you to enter this directory?
1. Try this again, but after typing in cd this, press the TAB key. What is now displayed on the prompt? 1. Try this again, but after typing in cd this, press the TAB key. What is now displayed on the prompt?
* This is an example of autocompletion, which is an invaluable tool not only for saving time, but for preventing spelling errors. * This is an example of autocompletion, which is an invaluable tool not only for saving time, but for preventing spelling errors.
@ -175,49 +175,49 @@ this is a test
## Guided Exercises ## Guided Exercises
1. Use the following file structure to answer the following three questions: 1. Use the following file structure to answer the following three questions:
``` ```
/ /
├── etc/ ├── etc/
│ ├── network/ │ ├── network/
│ │ └── interfaces/ │ │ └── interfaces/
│ ├── systemd/ │ ├── systemd/
│ │ ├── resolved.conf │ │ ├── resolved.conf
│ │ ├── system/ │ │ ├── system/
│ │ ├── system.conf │ │ ├── system.conf
│ │ ├── user/ │ │ ├── user/
│ │ └── user.conf │ │ └── user.conf
│ └── udev/ │ └── udev/
│ ├── rules.d │ ├── rules.d
│ └── udev.conf │ └── udev.conf
└── home/ └── home/
├── lost+found/ ├── lost+found/
├── user/ ├── user/
│ └── Documents/ │ └── Documents/
└── michael/ └── michael/
└── Music/ └── Music/
``` ```
* What command will navigate into the network directory regardless of your current location? * What command will navigate into the network directory regardless of your current location?
* What command can user enter to navigate into their Documents directory from /etc/udev? Use the shortest possible path. * What command can user enter to navigate into their Documents directory from /etc/udev? Use the shortest possible path.
* What command can user enter to navigate into michael 's Music directory? Use the shortest possible path. * What command can user enter to navigate into michael 's Music directory? Use the shortest possible path.
1. Consider the following output of ls -lh to answer the next two questions. Note that directories are indicated with a d at the beginning of the line. 1. Consider the following output of ls -lh to answer the next two questions. Note that directories are indicated with a d at the beginning of the line.
``` ```
drwxrwxrwx 5 eric eric 4.0K Apr 26 2011 China/ drwxrwxrwx 5 eric eric 4.0K Apr 26 2011 China/
-rwxrwxrwx 1 eric eric 1.5M Jul 18 2011 img_0066.jpg -rwxrwxrwx 1 eric eric 1.5M Jul 18 2011 img_0066.jpg
-rwxrwxrwx 1 eric eric 1.5M Jul 18 2011 img_0067.jpg -rwxrwxrwx 1 eric eric 1.5M Jul 18 2011 img_0067.jpg
-rwxrwxrwx 1 eric eric 1.6M Jul 18 2011 img_0074.jpg -rwxrwxrwx 1 eric eric 1.6M Jul 18 2011 img_0074.jpg
-rwxrwxrwx 1 eric eric 1.8M Jul 18 2011 img_0075.jpg -rwxrwxrwx 1 eric eric 1.8M Jul 18 2011 img_0075.jpg
-rwxrwxrwx 1 eric eric 46K Jul 18 2011 scary.jpg -rwxrwxrwx 1 eric eric 46K Jul 18 2011 scary.jpg
-rwxrwxrwx 1 eric eric 469K Jan 29 2018 Screenshot from 2017-08-13 21-22-24.png -rwxrwxrwx 1 eric eric 469K Jan 29 2018 Screenshot from 2017-08-13 21-22-24.png
-rwxrwxrwx 1 eric eric 498K Jan 29 2018 Screenshot from 2017-08-14 21-18-07.png -rwxrwxrwx 1 eric eric 498K Jan 29 2018 Screenshot from 2017-08-14 21-18-07.png
-rwxrwxrwx 1 eric eric 211K Jan 29 2018 Screenshot from 2018-01-06 23-29-30.png -rwxrwxrwx 1 eric eric 211K Jan 29 2018 Screenshot from 2018-01-06 23-29-30.png
-rwxrwxrwx 1 eric eric 150K Jul 18 2011 tobermory.jpg -rwxrwxrwx 1 eric eric 150K Jul 18 2011 tobermory.jpg
drwxrwxrwx 6 eric eric 4.0K Apr 26 2011 Tokyo/ drwxrwxrwx 6 eric eric 4.0K Apr 26 2011 Tokyo/
-rwxrwxrwx 1 eric eric 1.4M Jul 18 2011 Toronto 081.jpg -rwxrwxrwx 1 eric eric 1.4M Jul 18 2011 Toronto 081.jpg
-rwxrwxrwx 1 eric eric 1.4M Jul 18 2011 Toronto 085.jpg -rwxrwxrwx 1 eric eric 1.4M Jul 18 2011 Toronto 085.jpg
-rwxrwxrwx 1 eric eric 944K Jul 18 2011 Toronto 152.jpg -rwxrwxrwx 1 eric eric 944K Jul 18 2011 Toronto 152.jpg
-rwxrwxrwx 1 eric eric 728K Jul 18 2011 Toronto 173.jpg -rwxrwxrwx 1 eric eric 728K Jul 18 2011 Toronto 173.jpg
drwxrwxrwx 2 eric eric 4.0K Jun 5 2016 Wallpapers/ drwxrwxrwx 2 eric eric 4.0K Jun 5 2016 Wallpapers/
``` ```
* When you run the command ls -lrS, what file will be at the beginning? * When you run the command ls -lrS, what file will be at the beginning?
* Please describe what you expect to see as the output for ls -ad \*/. * Please describe what you expect to see as the output for ls -ad \*/.
@ -232,14 +232,14 @@ drwxrwxrwx 2 eric eric 4.0K Jun 5 2016 Wallpapers/
## Guided Exercises ## Guided Exercises
1. Given the following, select the directories that would be created by the command mkdir -p /tmp/outfiles/text/today /tmp/infiles/text/today 1. Given the following, select the directories that would be created by the command mkdir -p /tmp/outfiles/text/today /tmp/infiles/text/today
``` ```
$ pwd $ pwd
/tmp /tmp
$ find $ find
. .
./outfiles ./outfiles
./outfiles/text ./outfiles/text
``` ```
* /tmp * /tmp
* /tmp/outfiles * /tmp/outfiles
* /tmp/outfiles/text * /tmp/outfiles/text
@ -252,12 +252,12 @@ $ find
1. What happens when you use mv to move a directory into itself? 1. What happens when you use mv to move a directory into itself?
1. How would you delete all files in your current directory that start with old? 1. How would you delete all files in your current directory that start with old?
1. Which of the following files would log_[a-z]\_201?\_\*\_01.txt match? 1. Which of the following files would log_[a-z]\_201?\_\*\_01.txt match?
``` ```
log\_3\_2017_Jan_01.txt log\_3\_2017_Jan_01.txt
log_+_2017_Feb_01.txt log_+_2017_Feb_01.txt
log_b_2007_Mar_01.txt log_b_2007_Mar_01.txt
log_f_201A_Wednesday_01.txt log_f_201A_Wednesday_01.txt
``` ```
1. Create a few globs to match the following list of file names: 1. Create a few globs to match the following list of file names:
* doc100 * doc100
* doc200 * doc200