New York City College of Technolos What L/shor more oon one way to du thie Your
ID: 3587240 • Letter: N
Question
Explanation / Answer
Answer#7. The 'uptime' command will give you the time elapsed since the last reboot. Additionally, it gives the following information:-
Current time, number of users logged in, load average.
The time elapsed is the second value which is displayed.
So a command that can be used for this is : uptime
Answer#8. Use the %s command.
The syntax of the %s command is :- %s/search string/replacement string/
Open the file baseball.txt in vi.
Then press Esc, followed by the colon (:) and then type %s/yankees/mets/ and press ENTER.
So the command is, :%s/yankees/mets/
Answer #9. Use the cut command eith -d and -f parameters for this. The -d parameter is used when we want to extract substrings based on some delimiter.
The -f parameter is used for field numbers to be extracted.
So, the command for this would be, cut -d ':' -f 1,6 /etc/passwd
This will extract the first field and the sixth field from each line of the /etc/passwd file, where the fields are separated by colons (:), giving the required result.
Unfortunately, linux refuses to load onto my system so I can't show you the screenshots of the results of these commands.
Hope this helps!