| 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 | |
|
| 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. | |
|
| 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! |
|
|
|