Changes

Jump to: navigation, search
INVESTIGATION 3: QUOTING SPECIAL CHARACTERS
# Issue the following Linux command (using double quotes): <span style="color:blue;font-weight:bold;font-family:courier;">echo "$USER"</span><br><br>What happened? Why?<br><br>
# Let's use quoting special characters for a couple of other commands. Move to the '''lesson2''' directory. Confirm that you are currently located in the ''lesson2'' directory.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cp /bin/ls .</span><br><br># Issue the '''ls''' command to verify that there are copied files in your lesson2 directory.<br><br>NOTE: Although it is NOT RECOMMENDED to create a filename using a special character (remember that file naming rule?), we will create an empty file called "*"<br><br># Issue the following Linux command (using single quotes): <span style="color:blue;font-weight:bold;font-family:courier;">touch '*'</span><br><br># Issue the '''ls''' command. Do you now see a file called "*" in addition to the other copied files?<br><br># Issue the following Linux command to remove the file called "*": <span style="color:blue;font-weight:bold;font-family:courier;">rm *</span><br><br># Issue the '''ls''' command to view the files in your current directory. What happened?!? Why is it dangerous to use special characters when creating filenames?<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cp /bin/ls .</span><br><br># Issue the following Linux command (using single quotes): <span style="color:blue;font-weight:bold;font-family:courier;">touch '*'</span><br><br># Issue the following Linux command (using single quotes): <span style="color:blue;font-weight:bold;font-family:courier;">rm '*'<br><br># Issue the '''ls''' command to confirm that the file called "*" has been in your current directory. What happened this time?<br><br>
<br><br>
13,420
edits

Navigation menu