Posted: September 14th, 2017

Unix and shell commands

Unix and shell commands

 

1.(4 pts) What needs to be the very first line of a shell script?

2.(12 pts) Shell scripts can use special shell characters. Provide the special character(s) that indicate(s)….
a)the beginning of a shell variable name.
b)all characters a through z.
c)characters x or y
d)a command to match on one character

3.(4 pts) How can you change from the current shell into a C shell? Give the appropriate command.

4.(4 pts) Where can you find what shells are available on your system?

5.(4 pts) Define an alias called ‘checkcron’ for the command ps –ef | grep cron.

6.(8 pts) Is it possible to string a list of commands separated by the | (pipe) command that uses up 140 characters?
If your answer is yes, explain how.
If your answer is no, explain why?

7.(8 pts) Given the following information, what output is produced by the command listed below:
Given

$ pwd
/home/user1
$ echo $HOME
/home/user1

Command
$ env | grep HOME | wc

8.(8 pts) Related to text and script files
a)What’s the difference in permissions between a plain text file and a script?
b)Compose a command to make a text file named “checkdisks” into a script?

9.(4 pts) What two characteristics tell you a one-word variable name is an environment variable?

10.(4 pts) Compose a command to search the directory you are in for a file named batchlog for the word ‘error1’. If the batchlog file is not found, echo an the error message “file not found”

11.(4 pts) Compose a command to generate a list of all active processes, search for ‘daemon’ within them, and then display the results one page at a time.
12. (4 pts) What is meant by the word daemon in Linux?

13.(4 pts) Compose a command to take the boot log (from dmesg), search for eth1 and display only the last five matches.

14.(4 pts) Compose a command to find the disk usage for every directory in the system, sort them in descending order, then save the top ten entries in a file called ‘worst disk hogs’.

15.(4 pts) Compose a command to create a summary of disk usage by ‘jones’ along with the time and date of the last modification of any file in the directory or sub-directories and append it to the file ‘jones disk usage history’.

16.(4 pts) Why may a system engineer be interested in both the disk usage and the last modification date for the user jones?

17.(4 pts) Where does cd ~ put you?

18. (12 pts) This question is about the tar command. Use the commands in the Given section to help you answer the questions.

Given
$ pwd
/home/user1
$ ls –l photos
photo photo0 photo1 photo2 photo3 photo4 photo5 photo6 photo7

a) What does this command do?
$ tar cvf vacation.tar photos

b) What alternate tar command can you construct that will save disk space?

TO ORDER FOR THIS QUESTION OR A SIMILAR ONE, CLICK THE ORDER NOW BUTTON AND ON THE ORDER FORM, FILL ALL THE REQUIRED DETAILS THEN TRACE THE DISCOUNT CODE,
TYPE IT ON THE DISCOUNT BOX AND CLICK ON ‘USE CODE’ TO EFFECT YOUR DISCOUNT. THANK YOU

 

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp