Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Learning Ubjectives and Uutcomes In this lab you will learn to use the bash history feature to view and repeat previous commands. You will also
Learning Ubjectives and Uutcomes In this lab you will learn to use the bash history feature to view and repeat previous commands. You will also experin aliases that can translate one (usually shorter) command into another, and functions that can perform a series of comn Reading Read the sections on history (Sobell), using exclamation points to reference events (Sobell, pages 331-332), aliases ( pages 342-345), and functions (Sobell). Procedure 1. Type the following commands: $ head /etc/services $1s/etc $ who $ date 2. Use the up arrow key to repeat a display of the last command. 3. Use history and tail (Sobell) to list the 10 most recent commands you issued. It is okay if you have only the preceding five commands in your history list. Read "Using an Exclamation Point (!) to Reference Events" in Sobell1. a. Repeat the ls /ete command using that command's event number (Sobell). b. Repeat the date command by specifying it as the n th preceding command. Be careful: Each time you issue a command, the relative number of each preceding command changes. You might want to give another history command before you proceed. c. Repeat the previous command using !. 4. Create an alias (Sobell) that translates the command d into date. Make sure the new alias works. Display the alias. 5. Create an alias that translates the command is into sl. Test the alias. Give a Is command that does not use the alias. Remove the alias and show that the alias no longer exists. 6. Where would you define an alias so that it is available each time you log in? 7. Write a one-line function (Sobell, page 346) named welcome that displays Welcome to my computer. Demonstrate that the function works. 8. Write a function named long that displays the date and a long listing of the working directory. Demonstrate function works. 9. Where would you define a function so that it is available each time you log in
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started