Question

In: Computer Science

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.)

Project 2-4 In this hands-on project, you use and protect shell metacharacters.

1. Switch to a command-line terminal (tty2) by pressing CtrlþAltþF2 and log in to the terminal using the user name of root and the password of LNXrocks!.

2. At the command prompt, type date;who and press Enter to run the date command immediately followed by the who command. Use the information in Table 2-7 to describe the purpose of the ; metacharacter.

3. At the command prompt, type echo This is OK and press Enter to display a message on the terminal screen.

4. At the command prompt, type echo Don’t do this and press Enter. Which character needs to be protected in the previous command? Press the Ctrl and c keys together to cancel your command and return to a BASH shell prompt.

5. At the command prompt, type echo “Don’t do this” and press Enter. What is displayed on the terminal screen?

6. At the command prompt, type echo Don\’t do this and press Enter. What is displayed on the terminal screen?

7. At the command prompt, type echo $SHELL and press Enter to view the expansion of a variable using a shell metacharacter. What is displayed on the terminal screen? Next, type echo $TEST and press Enter to find out what happens when a variable that does not exist is used in a command. What is displayed?

8. At the command prompt, type echo You have $4.50 and press Enter. What is displayed? Why? Which character needs to be protected in the previous command? What are two different ways that you can protect this character from interpretation by the shell?

9. At the command prompt, type echo ‘You have $4.50’ and press Enter. What is displayed on the terminal screen? Did the single quotation marks protect this metacharacter from shell interpretation?

10. At the command prompt, type echo “You have $4.50” and press Enter. What is displayed on the terminal screen? Did the double quotation marks protect this metacharacter from shell interpretation?

11. At the command prompt, type echo You have \$4.50 and press Enter. What is displayed on the terminal screen? Did the backslash protect this metacharacter from shell interpretation?

12. At the command prompt, type echo My name is ‘whoami‘ and press Enter. What function do back quotes perform?

13. Type exit and press Enter to log out of your shell.

Solutions

Expert Solution

Below is the solution:

2. Answer:

john@Johns $ date;who
Thu Oct 22 09:11:45 IST 2020
john    console Oct 22 09:00
john    ttys000 Oct 22 09:00

semi colon will terminatet he command and when run the multiple command it will show the output of the each command related to the commad.

3. Answer:

john@Johns $ echo This is OK
This is OK

When we type the echo command it will print or display

4. Answer:

john@Johns $ echo Don’t do this
Don’t do this

No any charater needs to protect

5. Answer:

john@Johns $ echo “Don’t do this”
“Don’t do this”

Display the all the info with all the typed string, special character

6. Answer:

john@Johns $ echo Don\’t do this
Don’t do this

Neglet the forward slash

7. Answer:

john@Johns $ echo $SHELL
/bin/bash

Prints the shell name user is logged in

8. Answer:

john@Johns $ echo You have $4.50
You have .50

Terminal execute the echo command and prints, $4 will terminal execute as a command in terminal.

9. Answer:

john@Johns $ echo ‘You have $4.50’
‘You have .50’

Terminal execute the echo command and prints, $4 will terminal execute as a command in terminal in single quote string.

10. Answer:

john@Johns $ echo “You have $4.50”
“You have .50”

Terminal execute the echo command and prints, $4 will terminal execute as a command in terminal in double quote string.

11. Answer:

john@Johns $ echo You have \$4.50
You have $4.50

Terminal execute the echo command and prints, forward slash will terminal execute as a string in terminal.

12. Answer:

john@Johns $ echo My name is ‘whoami‘

My name is john

Prints the user name


Related Solutions

CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-6 In this hands-on project, you properly shut down your Linux system. 1. Press CtrlþAltþF2 to switch to a command-line terminal (tty2), and then log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type poweroff to shut down your Linux system immediately. Which commands from Table...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-3 In this hands-on project, you log in to a graphical terminal in Fedora Linux and interact with the GNOME and KDE desktops. 1. Switch to the graphical terminal (tty1) by pressing CtrlþAltþF1, click user1, supply the password of LNXrocks!, and click Sign In. Which desktop is started and why? 2. The first time you log into the...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-5 In this hands-on project, you find information about commands using help utilities. 1. Press CtrlþAltþF2 to switch to a command-line terminal (tty2), and then log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type man –k cron and press Enter to view a list of...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 2-2 In this hands-on project, you explore some command-line terminals on a Linux system and enter some basic commands into the BASH shell. 1. After your Linux system has been loaded, you are placed at a graphical terminal (tty1). Instead of logging in to this graphical terminal, press CtrlþAltþF2 to switch to a command-line terminal (tty2) and then...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 4-6 In this hands-on project, you delete files and directories using the rmdir and rm commands. 1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type cd samples and press Enter. At the command prompt,...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it in a mac and add pictures of the machine.) Project 4-7 In this hands-on project, you apply and modify access permissions on files and directories and test their effects. 1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type touch permsample and press Enter. Next,...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it on mac and please...
CompTIA Linux+ Guide to Linux Certification (4th Edition)(Please do not do it on mac and please add photos of the virtual machine.) Project 4-11 In this hands-on project, you configure and research filesystem attributes. 1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of LNXrocks!. 2. At the command prompt, type touch toughfile and press Enter. Next, type lsattr toughfile at the command prompt...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that you work for a company that is developing a telephone database and you are creating directories for the Mail and Receiving Departments, which are referenced in the company’s budget and accounting systems as departments 4540 and 4550. After you create the directories, you begin creating files of department phone numbers to store in those directories. You must use the mkdir (make directory) command to...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to...
Guide to UNIX Using Linux (4th Edition) 1.What is sed? A Stream editor is used to perform basic transformations on text read from a file or a pipe. The result is sent to standard output. The syntax for the sed command has no output file specification, but results can be saved to a file using output redirection. The editor does not modify the original input. What distinguishes sed from other editors, such as vi and ed, is its ability to...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management course material as a guide and the Earned Value (EV) formulas described in the example problem, answer the questions below by showing your calculations and solutions for each project parameter. Our 6-month project example is described as follows: Total Hours of Work:  1,100 Hours Cost per Hour:  $185 per hour Project cost at end of month three: $110,000 Estimated work complete at end of month three:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT