Hi my homework is to " end operation of less browsers" using fuser, so i assume i need to close terminal running less comand using kill. I wrote in terminal sudo fuser -v -k -i . and i have some list. How using that i can kill less comand whcih is in the image below?
Not going to get you a full answer as this is homework.
Could you use fuser in a similar way that ps? There are often smarter ways doing these, but noticed often this grep/cut approach works in many places. For example when I want to see processes of specific name I grep the output by the string 'less'
Then pipe it to
cut
(or awk) to get a specific field (the process number)https://man7.org/linux/man-pages/man1/cut.1.html
And then wrap it in the backticks to be fed into the kill command. Example to find java process and kill it:
or
Can you use similar ideas to your problem?