Home > Archive > Linux/Unix > February 2004 > Linux+ Question of the Day





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Linux+ Question of the Day
Boulware5

2004-02-24, 2:01 pm

Which command will allow you to see the last 10 lines of /var/log/messages?

a. tail -10 /var/log/messages
b. tail +10 /var/log/messages
c. head -10 /var/log/messages
d. head +10 /var/log/messages
e. cat /var/log/messages
Supertech

2004-02-24, 3:04 pm

a. tail -10 /var/log/messages

Actually, the -10 isn't really necessary as the tail command prints the last 10 lines of each file to standard output by default.
prezbedard

2004-02-24, 6:58 pm

cat /var/log/messages
Dr. C

2004-02-25, 8:41 am

quote:
Originally posted by Supertech
a. tail -10 /var/log/messages

Actually, the -10 isn't really necessary as the tail command prints the last 10 lines of each file to standard output by default.



Ditto.
Dr. C

2004-02-25, 8:42 am

quote:
Originally posted by prezbedard
cat /var/log/messages


That would siplay all the lines in the file.
prezbedard

2004-02-25, 10:17 am

Thanks. I ran both commands looked the same to me. Though I used
cat +10 /var/log/messages
Dr. C

2004-02-25, 10:36 am

quote:
Originally posted by prezbedard
Thanks. I ran both commands looked the same to me. Though I used
cat +10 /var/log/messages



cat + 10 would work, but cat by itself would blast all lines to stdout, so you'd only see the last screen of text unless you piped it through a pager.
Tarzanboy

2004-02-25, 11:17 am

a
Boulware5

2004-02-29, 11:59 pm

(a) is correct!
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net