Find the answer to your Linux question:
Results 1 to 2 of 2
hi 1. I m just new to shell script.. here i have to display the last line of my file without using "wc -l" command... 2. Also i want to ...
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    13

    display last line

    hi

    1. I m just new to shell script.. here i have to display the last line of my file
    without using "wc -l" command...

    2. Also i want to know about any alternate command for "head" and "tail".

    thankyou

  2. #2
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    wc -l will give you the count of lines and won't print any line.

    tail is what almost any one would use for this kind of task.

    You can also use sed to do this :

    sed one-liners
    0 + 1 = 1 != 2 <> 3 != 4 ...
    Until the camel can pass though the eye of the needle.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...