igreenius
Posts: 11
Joined: Wed Aug 19, 2015 7:26 am

TAIL command not found

Mon Oct 26, 2015 5:32 am

Can someone help to install tail command?

I tried command below.

command: tail -1000 /var/log/syslog
result: tail -1000 /var/log/syslog: command not found

/opt/vc/bin/vcgencmd version
Apr 21 2015 14:42:19
Copyright (c) 2012 Broadcom
version 2d5ad04b63af4233440c3f7c8587108223201102 (clean) (release)

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: TAIL command not found

Mon Oct 26, 2015 6:29 am

I am assuming that you are using Raspbian. Is that correct? If so the tail command is in the coreutils package and is installed by default.

What do you get if from

Code: Select all

ls -l /usr/bin/tail

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: TAIL command not found

Mon Oct 26, 2015 6:57 am

That looks like a copy/paste error. If the tail command wasn't installed you would get just

bash: tail: command not found

As you got the whole message it seems the shell isn't recognising the spaces, so they are possibly some bad characters if you copied the command from a website. Try typing it in by hand.

igreenius
Posts: 11
Joined: Wed Aug 19, 2015 7:26 am

Re: TAIL command not found

Mon Oct 26, 2015 7:18 am

AndyD, thanks for that. I realized that tail is indeed installed.
rpdom , thanks also for your thoughts.
My bad on this. I checked my code and I found out that I made a logic that if the phrase 'not found' is in the result. It will output the 'command + "command not found"'.
I think that the syslogs has an entry with 'not found' phrase that is why I'm getting the output.

I tried: tail -10 /var/log/syslog to get the last 10 entries and worked perfectly.

Thanks again.

Return to “Beginners”