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
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 shells 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?
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