Re: tail and head command...
Thats the difference and you can also use different options with each of the commands. Type man tail/head at command prompt for more!!!!
Re: tail and head command...
I am not so sure if you know this or not, but just in case you don't know there is a small difference in the option part of these commands i.e.
[b][i]head -n filename[/b][/i]: Displays first 'n' lines from the specified file
[b][i]tail -n filename[/b][/i]: Displays last 'n' lines from the specified file
[b][i]tail +n filename[/b][/i]: Displays lines starting from number 'n' to the last line from the specified file.
But no such difference is there if you use '+' option with the head command.
Of course you can use [b][i]man[/b][/i] command to find out more.
Thanks and Regards
Ashis
Re: tail and head command...
[QUOTE=psuresh1982;14558]what is the difference between tail and head command? I know the following difference, "[B]tail shows last lines (the tail) of the given file, head shows you the first lines (the head) of the given file[/B]".
I want to know whether anyother difference are there or not?
-----------------
suresh[/QUOTE]
head is used for open the specified file
but tail is not user for open the file
ex:
head file1 file2 file3
Re: tail and head command...
[QUOTE=sarathi trichy;21892]head is used for open the specified file
but tail is not user for open the file
ex:
head file1 file2 file3[/QUOTE]
You can use both [b]head[/b] as well as [b]tail[/b] command to open a file. The point to notice is that in both the cases a default value of 10 is taken i.e.
[b]head filename[/b]: Will display first 10 lines from the file, and
[b]tail filename[/b]: Will display last 10 lines from the file.
Cheers
Ashis