Question

In: Computer Science

CAN YOU EXPLAIN THE OUTPUT. awk ‘ { print $1 } ' ls –l | cut...

CAN YOU EXPLAIN THE OUTPUT.

awk ‘ { print $1 } '

ls –l | cut –c57-80 > /tmp/process_names.txt

who | awk ‘{print $1}‘ | sort –u | wc –l ps -ef | awk '{print $2}' person=`who | grep $1`

grep ERR app.log >/tmp/errors.txt

umask -S

Solutions

Expert Solution

1.awk '{print $1}'

Prints first field or column of the given file

2.ls –l | cut –c57-80 > /tmp/process_names.txt

output of ls -l (long listing of file) is given to the input to the command cut, which extract characters starting from 57 to 80

Note:'|' is pipe operator which pass output of one command as the input to another command

Those extracted 24 characters are stored into the file /tmp/process_names.txt using output redirection operator(>)

3. who | awk ‘{print $1}‘ | sort –u | wc –l ps -ef | awk '{print $2}' person=`who | grep $1`

who command displays a list of users who are currently logged into the computer, it is passed to the command awk ‘{print $1}‘ , which print the first column(username)

sort -u sort and remove duplicates of username

wc -l print no of lines in the information about all accessible processes returned by the command ps -ef,

4. grep ERR app.log >/tmp/errors.txt

grep command select all lines containing the pattern "ERR" from app.log and that is stored in /tmp/errors.txt using output redirection operator(>)

5. umask -S

display current mask symbolically


Related Solutions

Can you explain the answer: thanks. who | awk ‘ { print $1 } ‘ |...
Can you explain the answer: thanks. who | awk ‘ { print $1 } ‘ | sort –u | wc –l ls –l | wc –l > /tmp/count find ~username –type –d –print person = `who | grep $1`
arduino programing Question 1: write an APL program that will print the following output on the...
arduino programing Question 1: write an APL program that will print the following output on the serial monitor 10 times only.   Output:  1 2 3 4 5 Question 2: write an APL program that will turn the traffic lights on and off by taking input from the Serial port working at 11500 bits processing rate. Use r or R for RED LIGHTS, y or Y for YELLOW LIGHTS and g or G for GREEN LIGHTS.    Question 3: write an APL...
A firm produces output according to the following function: q = f (L, K) = L^1/2...
A firm produces output according to the following function: q = f (L, K) = L^1/2 K^1/4 . The cost of labor is $8 per hour and the rental cost of capital is $2 per hour. a. Determine the returns to scale for this function. b. Suppose the firm wishes to produce at cost $96. How much capital and how much labor does the firm employ? c. Derive the short-run cost function with optimal amount of K from part b....
Suppose you have a wire of length L. You cut a length x to make a square and use the remaining
Suppose you have a wire of length L. You cut a length x to make a square and use the remaining length L - x to make a circle. Use MuPAD to find the length x that maximizes the sum of the areas enclosed by the square and the circle.
Please print so I can read clearly. Thank you 1. Describe the effects of aging on...
Please print so I can read clearly. Thank you 1. Describe the effects of aging on fluid and electrolyte regulation. 2. Electrolytes to investigate: (Sodium, Potassium, Calcium, Magnesium). Include causation, clinical manifestations, and nursing interventions.
Can you give me a list of some ideas on how I can cut costs in...
Can you give me a list of some ideas on how I can cut costs in order to try and stay within a budget? I need a 175 word count please. Thank you very much for your time and effort.
1. Suppose that output q is a function of a single input, labor (L). Describe the...
1. Suppose that output q is a function of a single input, labor (L). Describe the returns to scale associated with each of the following production functions: a. q = 3L. Answer: b. q = L3. Answer:
1) A woman can read the large print in a newspaper only when it is at...
1) A woman can read the large print in a newspaper only when it is at a distance of 69 cm or more from her eyes. (a) Is she nearsighted (myopic) or farsighted (hyperopic), and what kind of lens is used in her glasses to correct her eyesight? (b) What should be the refractive power (in diopters) of her glasses (worn 2.9 cm from the eyes), so she can read the newspaper at a distance of 22 cmfrom the eyes?...
Answer the questions –- Print so I can read it in PeN 1) Assume that a...
Answer the questions –- Print so I can read it in PeN 1) Assume that a solvent having more isopropanol than solvent G was used in the experiment. Predict whether dye A would migrate a smaller or larger distance in this solvent than in solvent F or G. Why? 2) TLC can be used to help identify unknown compounds. Explain how this might be accomplished using the dyes as an example. 3) READ Harris page 604-623 – define the following...
1. Find and print the length of the list listTest. 2. We can test if an...
1. Find and print the length of the list listTest. 2. We can test if an item exists in a list or not, using the keyword in It will give you a boolean response if a certain element is present. Find whether 'p' or 'P' is present in listTest, and print the results. Print results first for 'p' and then for 'P' as shown in example below. For example: Test Result listTest=['c','i','s','c','1','0','6','P','y','t','h','o','n'] False True 3. We can delete one or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT