1. Split the lines below into the components of command, option(s)/parameter(s) and argument(s):
* cat -n /etc/passwd
* ls -l /etc
* ls -l -a
* cd /home/user
1. Find what type the following commands are: (extenal commands or builtin)
* pwd
* mv
* cd
* cat
* exit
1. Resolve the following commands that use quotes:
* echo "$HOME is my home directory"
* touch "$USER"
* touch 'touch'
## Explorational Exercises
1. With one command and using brace expansion in Bash (review the man page for Bash), create 5 files numbered 1 to 5 with the prefix game (game1, game2, ...).
1. Delete all 5 files that you just created with just one command, using a different special character (review Pathname Expansion in the Bash man pages).
1. Is there any other way to make two commands interact with each other? What are those?
# Lesson 2.1.2
## Guided Exercises
1. Create a local variable **number**.
1. Create an environment variable **ORDER**, using one of the two above methods.
1. Display both the variable names and their contents.
1. What are the scopes of the previously created variables?
## Explorational Exercises
1. Create a local variable **nr_files** and assign the number of lines found in the /etc/passwd file. Hint: Look into the command wc and command substitution and don’t forget about quotation marks.
1. Create an environment variable **ME**. Assign the **USERNAME** variable’s value to it.
1. Append the **HOME** variable’s value to **ME**, having the : delimiter. Display the contents of the **ME** variable.
1. Using the date example above, create a variable called **today** and assign the date for one of the time zones.
1. Create another variable called **today1** and assign the system’s date to it.
# Lesson 2.2
## Guided Exercises
1. Use the man command to find out what each command does:
* ls
* cat
* cut
* cd
* cp
* mv
* mkdir
* touch
* wc
* passwd
* rm
* rmdir
* more
* less
* whereis
* head
* tail
* sort
* tr
* chmod
* grep
1. Open the ls info page and identify the MENU.
* What options do you have?
* Find the option that allows you to sort the output by modification time.
1. Display the path to the first 3 README files. Use the man command to identify the correct option for locate.
1. Create a file called test in your home directory. Find its absolute path with the locate command.
1. Did you find it immediately? What did you have to do in order for locate to find it?
1. Search for the test file that you previously created, using the find command. What syntax did you use and what is the absolute path ?
## Explorational Exercises
1. There is one command in the table above that doesn’t have a man page. Which one is it and why do you think that the command doesn’t 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. 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. Remove the entire directory tree with a single command.
# Lesson 2.3.1
## Guided Exercises
1. For each of the following paths, identify whether it is absolute or relative:
* /home/user/Downloads
* ../Reports
* /var
* 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:
* 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 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.
* 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 \*/.
## Explorational Exercises
1. Run the ls -lh command in a directory that contains subdirectories. Note the listed size of these directories. Do these file sizes seem correct to you? Do they accurately represent the contents of all files inside that directory?
1. Here is a new command to try: du -h. Run this command and describe the output that it gives you.
1. On many Linux systems, you can type in ll and get the same output as you would if you typed ls -l. Please note however that ll is not a command. For example, man ll will give you the message that no manual entry exists for it. This is an example of an alias. Why might aliases be useful to a user?
# Lesson 2.4
## 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