Question: I need help with my Linux / Unix programming class. Please use the MobaXterm terminal to write the code I am having trouble following the

I need help with my Linux / Unix programming class. Please use the MobaXterm terminal to write the code I am having trouble following the given procedure guidelines. Hope you are able to help me! Thank you

Objective: In this lab, you will learn to use the bash history feature to view and repeat previous commands. You will also experiment with aliases that can translate one (usually shorter) command into another, and with functions that can perform a series of commands.

Procedure to Follow :

1. Type the following commands:

$ head /etc/services

$ ls /etc

$ who

$ date

$ uname -a

2. Use history and tail to list the 10 most recent commands you issued. It is okay if you have only the preceding five commands in your history list.

3. Read Using an Exclamation Point (!) to Reference Events on Sobell, page 331.

a. Repeat the ls /etc command using that commands event number

b. Repeat the uname command by specifying it as the nth 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.

d. Repeat the most recent command that started with the string head

4. Create an alias that translates the command d into date. Make sure the new alias works. Display the alias.

5. Create an alias that translates the command ls into ls l. Test the alias. Give an ls 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 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 that the function works.

9. Where would you define a function so that it is available each time you log in?

Outcome: This lab gives you practice using history, aliases, and functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!