LINUX 9. What command can the current users execute to show a list of commands p
ID: 3879726 • Letter: L
Question
LINUX
9. What command can the current users execute to show a list of commands previously entered? Explain the utility of this command.
10. Which of the following describe a process (select all that apply):
a. a running program.
b. a running instance of a command.
c. identified by a Process ID number.
d. a potential program.
e. associated with a user account.
11. What are the results of using which for a command that is located a directory other than your current search path?
12. a. What command displays the current aliases?
b. Write an alias command to list only the hidden files within the current user’s home directory.
13. Explain the activity of the shell while a command is executing? How can you avoid waiting before running another command?
14. Enter the following command: $ sleep 30 | cat /etc/services
Is there any output from sleep? Where does cat get its input from? What has to happen before the shell will display a prompt?
15. Assume the PATH variable has been deleted, what are some of the problems that could arise? What is the reasons for these problems? What is the simplest way to restore PATH to its original state?
16. What can you do to make the function available every time you log in?
Explanation / Answer
9. For Linux systems we have a command called history. This command will displays all the commands entered by you in the terminal. Just type histoey and press enter then you get what you want.
10.
a. a running program.
b. a running instance of a command.
c. identified by a Process ID number.
11. Which command is Linux gives the executables with their full paths those are given as arguments to which command. It gives the executable location of that command.
12.
a. alias is the command which will list all the aliases existing.
b. alias hidden = 'ls - a /home | grep "^."'
13.
Shell just provide environment for executing commands. It doesn't do any thing while it is in process. We have to wait untill current one is done with execution. To avoid waiting we can execute the commands in background by typing & at the end of command in shell. So we can continue with another one.
14. When we execute this command the terminal doesn't give any response for 30 seconds and after that due to pipe symbol it will open the services file from etc folder. Before it opens this the display will show nothing for 30 seconds because of sleep command.
15.
Path variable stores paths to some of the services and to important libraries and executables. If this is deleted then the processor doesn't know where this services reside and ultimately executions or processes will get stopped.
Path will be restored when you restart the system. If not possible then find. bashrc which has original one and overwrite the path with this.
16. Put that function in ~/bash. profile and ~/bashrc files so that it will be executed everytime you login.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.