-3

How to display only the names of the last 10 services listed in /etc/services?

4
  • 1
    Is this a homework question?
    – jordanm
    Commented Mar 21, 2019 at 1:17
  • 2
    Seems like assignment/quiz questions :P Commented Mar 21, 2019 at 2:27
  • As the down-arrow hint says: This question does not show any research effort.
    – Juan
    Commented Mar 21, 2019 at 10:44
  • The title doesn't make a lot of sense compared with the body; could you clarify what you're after, here? Thank you!
    – Jeff Schaller
    Commented Mar 21, 2019 at 11:01

3 Answers 3

1
tail -n 10 /etc/services | cut -f 1 -d " "
0

Other way:

awk -F' ' 'NF=1' /etc/services |tail -n 10

or

awk -F' ' '{print $1}' /etc/services |tail -n 10

-2

You can use following command.

ls -ltr | tail

Not the answer you're looking for? Browse other questions tagged .