13,420
edits
Changes
→Part 1: Creating Directories
# Issue the following Linux command:<span style="color:blue;font-weight:bold;font-family:courier;">ls -d -l uli101</span><br><br>How can you confirm from the output of this command that the file uli101 is a directory?<br><br>
# Issue the following Linux command:<span style="color:blue;font-weight:bold;font-family:courier;">ls -ld uli101</span><br><br>Is the output from this command the same was the output from the previous command? If so, what does this say about how to use multiple options for Linux commands?<br><br>
# Issue the following Linux command to create the apc100 acp100 and xyz100 directories:<span style="color:blue;font-weight:bold;font-family:courier;">mkdir apc100 acp100 xyz100</span><br><br>'''NOTE:''' You should now notice that you can create multiple directories by issuing the mkdir with multiple arguments.<br><br># Issue the following Linux command to confirm that those directories have been created: <span style="color:blue;font-weight:bold;font-family:courier;">ls -ld apc100 acp100 xyz100</span><br><br>
# We will now create the subdirectories that are contained in the '''uli101''' directory. Issue the following Linux command to move to the uli101 directory: <span style="color:blue;font-weight:bold;font-family:courier;">cd uli101</span><br><br>
# Issue a command to confirm that your current location is in the uli101 directory. You should know how to issue this command from a previous tutorial.<br><br>
#This technique is considered to be '''inefficient'''... There are options and ways to create the same directory structure without using the cd command and only issue a single Linux command.<br><br>Using this inefficient method tends to show that you are a novice or "'''newbie'''", and you may '''lose marks''' if you issue multiple Linux commands to performed tasks that can be performed using only a single Linux command.<br><br>Although we will teach you how to '''remove''' directories and their contents in a future section, let's change back to your '''home''' directory and issue a command to '''remove the directory structure''' that you just created so you can learn a more efficient method of creating the same directory structure.<br><br>
# Issue Linux commands to move to your home directory and confirm that your current directory is your home directory. You should know how to do this...<br><br>
# Issue the following Linux command to remove all of the directories that you have created:<br><span style="color:blue;font-weight:bold;font-family:courier;">rm -r uli101 apc100 acp100 xyz100</span><br><br>'''NOTE:''' You will learn how to safely remove directories and their contents in another section.<br><br>
# Issue the following single Linux command to create the entire directory structure:<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir -p uli101/notes uli101/tutorials uli101/examples acp100 xyz100</span><br><br>'''NOTE:''' The '''-p''' option allows "parent" directories to be automatically created first to then create their subdirectories.<br><br>
# Issue the following Linux command to confirm that all of the directories have been created:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -ld uli101 uli101/notes uli101/tutorials uli101/examples apc100 acp100 xyz100</span><br><br>
'''Downloading & Running a Shell Script to Check your Work'''