Please answer the following questions. 1. Explain the difference between the /et
ID: 3729395 • Letter: P
Question
Please answer the following questions.
1. Explain the difference between the /etc/profile and the ~/.bash_profile file. Which one is executed first?
2. Edit your .bash_profile file as follows:
a. Welcome the user
b. Add your home directory to the path if it is not there
c. Set erase to the Backspace key using stty.
d. Type source .bash_profile. What is the function of the source command?
3. What is the default primary prompt of the bash file from question 2?
a. Change the prompt to include the time of day and your home directory.
b. What is the default secondary prompt? What is its function?
4. What is the difference between a program and a process? What is a job?
5. What command brings a background job into the foreground?
6. How do you list all running jobs? All stopped jobs?
7. Make a directory called wildcards. Cd to that directory and type at the prompt:
touch ab abc a1 a2 a3 all a12 ba ba.1 ba.2 filex filey AbC ABC ABc3 abc
Write and test the command that will do the following:
a. List all files starting with a.
b. List all files ending in at least one digit.
c. List all files starting with a or A
d. List all files ending in a period, followed by a digit.
e. List files ending in x or y
f. List all files ending in a digit, an uppercase letter, or a lowercase letter.
8. What command would you use to do the following:
a. Redirect the output of the ls command to a file called lsfile?
b. Redirect and append the output of the date command to lsfile?
c. Redirect the output of the who command to lsfile? What happened?
9. Use the find command to find all files, starting from the parent directory, of type directory. Save the standard output in a file called found and any errors in a file called found.errs.
10. What is a positional parameter? Type at the command line:
set dogs cats birds fish
a. How do you list all of the positional parameters?
b. Which positional parameter is assigned birds?
c. How do you print the number of positional parameters?
d. How do you remove all the positional parameters from the shell’s memory?
11. What is an environment variable? What is the command used to list them? Create an environment variable called CITY and assign it the value of your hometown. How do you export it?
Explanation / Answer
Answer:
1.
In the event that you have been utilizing Linux for some time you are presumably acquainted with the .profile or .bash_profile records in your home registry. These records are utilized to set ecological things for a clients shell. Things, for example, umask, and variables, for example, PS1 or PATH.
The/and so on/profile record isn't altogether different anyway it is utilized to set framework wide natural variables on clients shells. The variables are now and then similar ones that are in the .bash_profile, however this record is utilized to set an underlying PATH or PS1 for all shell clients of the framework.
Like .bash_profile you will likewise normally observe a .bashrc record in your home catalog. This document is implied for setting summon nom de plumes and capacities utilized by bash shell clients.
Much the same as the/and so on/profile is the framework wide form of .bash_profile. The/and so on/bashrc for Red Hat and/and so on/bash.bashrc in Ubuntu is the framework wide form of .bashrc.
Strikingly enough in the Red Hat usage the/and so on/bashrc additionally executes the shell contents inside/and so on/profile.d however just if the clients shell is an Interactive Shell (otherwise known as Login Shell)
DEAR STUDENT ! DUE TO COMPANY NORMS, WE ARE SUPPOSED TO ANSWER A SINGLE QUESTION FROM MULTIPLE PSORED QUESTIONS. KINDLY POST SEPARATELT TO GET ANSWERED.
RATE IT IF HELPS ELSE LET ME KNOW YOUR DOUBT.
THANK YOU!!