In: Computer Science
Linux operation
1. Explain what this command does: rpm –qai | more ..... ?
2. Ps – Af |grep -v ^root, Explain how this command to find application processes could helpful in the real world to the system administrator??
3. Clearly describe 3 valid command options, and their meaning, of this command used to add users?
4. List 2 different variants of the Unix (not Linux) operating system, as well as their corresponding vendor (the company that developed them) ?
Determine if the UP ARROW for the recalling of commands in the BASH shell is persistent across logins. In other words, are previous commands preserved and able to be recalled by UP ARROW from one login to the next, using the same login account? (yes or no) 27.) .
If yes, clearly explain in detail why/how the BASH shell recalls these commands. Provide the technical answer as to what the shell uses to perform this action. Do not provide an answer which details how the user recalls the commands by just hitting the up arrow for example, but rather again, how the shell does this from a technical perspective, what it uses, etc. (Research if necessary):
28.) .
(If you have problems recalling previous commands with UP ARROW, ensure you are in the BASH shell when using UP ARROW, by running echo $SHELL, and it should display /bin/bash). We will see more about “variables”, like SHELL later in the course.
1.RPM is a Red Hat Package manager.
Command : rpm –qai | more
Here "q" is Query, means you want to fetch something
'a' means all
'i' means Installed packages
'more' is used for showing all the content even if it is more ...!
Finally the "command queries to display all the installed packages...!!"
2. Command : Ps – Af |grep -v ^root
In this command "Ps – Af" gives all running processes with full format listing (i.e Gives extra information about the process).
'grep -v ^root' grep is used to search something 'v' is used as invert (mean that it will select non-matching line).
Finally command is used to show all the processes that root is not involved ( Simply non-root processes).
3.There are two similar commands for adding user
1.adduser -> Mostly used by administrator for creating user
2. useradd -> It is a low level utility for adding users mostly used by non-root users
Both have option
"-d " => This will create new user in HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name.
"-e" => Means expire date.The date on which the user account will be disabled(format YYYY-MM-DD).
"-p" => It is used to set password for the new user.By default there will be no password.
4.Solaris - Oracle Corporation
Darwin - Apple Inc & Open source community
5.The UNIX operating systems can remember all the commands you have ever typed during all your log-in sessions. Each command that you have typed, correctly or not, is stored in a file, in your default home directory, called: .bash_history
It fetches the previous commands from that file.There are many ways that you can call the previous commands.
1. "History" -> This command lists all the
commands that you have used.(It fetches from .bash_history)
2."up arrow" -> Used to show previously used commands
3."!!" -> This command executes the previous command
4."!<search_word>" -> Executes the most recent command that matches with search_word.
Thankyou : )