Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the terminal using the user name of root and the password

1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the terminal using the user name of root and the password of LINUXrocks!. 2. At the command prompt, type set | less and press Enter to view the BASH shell environment variables currently loaded into memory. Scroll through this list using the cursor keys on the keyboard. When finished, press q to quit the less utility. 3. At the command prompt, type env | less and press Enter to view the exported BASH shell environment variables currently loaded into memory. Scroll through this list using the cursor keys on the keyboard. Is this list larger or smaller than the list generated in Step 2? Why? When finished, press q to quit the less utility. 4. At the command prompt, type PS1="Hello There:" and press Enter. What happened and why? Next, type echo $PS1 at the command prompt and press Enter to verify the new value of the PS1 variable. 5. At the command prompt, type exit and press Enter to log out of the What prompt did you receive and why? How could you ensure that the Hello There: prompt occurs at every login? 6. At the command prompt, type vi .bash_profile and press Enter. At the bottom of the file, add the following lines. When finished, save and quit the vi editor. echo e "Would you like a hello prompt? (y/n) -->\c" read ANSWER if [ $ANSWER = "y" -o $ANSWER = "Y" ] then PS1="Hello There: " fi Explain what the preceding lines will perform after each login. 7. At the command prompt, type exit and press Enter to log out of the shell. Next, log in to the terminal using the user name of root and the password of LINUXrocks!. When prompted for a hello prompt, type y and press Enter. What prompt did you receive and why? 8. At the command prompt, type exit and press Enter to log out of the shell. Next, log in to the terminal using the user name of root and the password of LINUXrocks!. When prompted for a hello prompt, type n and press Enter to receive the default prompt. 9. At the command prompt, type MYVAR="My sample variable" and press Enter to create a variable called MYVAR. Verify its creation by typing echo $MYVAR at the command prompt, and press Enter. 10. At the command prompt, type set | grep MYVAR and press Enter. Is the MYVAR variable listed? Why? 11. At the command prompt, type env | grep MYVAR and press Enter. Is the MYVAR variable listed? Why? 12. At the command prompt, type export MYVAR and press Enter. Next, type env | grep MYVAR at the command prompt and press Enter. Is the MYVAR variable listed now? Why? 13. At the command prompt, type exit and press Enter to log out of the shell. Next, log in to the terminal using the user name of root and the password of LINUXrocks!. 14. At the command prompt, type echo $MYVAR and press Enter to view the contents of the MYVAR variable. What is listed and why? 15. At the command prompt, type vi .bash_profile and press Enter. At the bottom of the file, add the following line. When finished, save and quit the vi editor. export MYVAR="My sample variable" 16. At the command prompt, type exit and press Enter to log out of the shell. Next, log in to the terminal using the user name of root and the password of LINUXrocks!. 17. At the command prompt, type echo $MYVAR and press Enter to list the contents of the MYVAR variable. What is listed and why? 18. At the command prompt, type alias and press Enter. Note the aliases that are present in your shell.shell. Next, log in to the terminal again using the user name of root and the password of LINUXrocks!.

19. At the command prompt, type alias asample="cd /etc ; cat hosts ; cd ~ ; ls F" and press Enter. What does this command do? 20. At the command prompt, type asample and press Enter. What happened and why? What environment file could you add this alias to such that it is executed each time a new BASH shell is created? 21. Type exit and press Enter to log out of your shell.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions

Question

Analyze the legal and safety issues concerning workplace toxins.

Answered: 1 week ago