This is the way you want i guess:
pandeeswaran@ubuntu:~/training$ cat Myfile
EMP_ID | DEPT_NAME
6965828|Physics One
7510197|Physics One
4789042|Physics One
7991528|Physics One
pandeeswaran@ubuntu:~/training$ sed -e '1d' Myfile|sed -n '$='
4
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
I want to get the line count of a file, excluding the first line. How can I achieve it using sed? File content:
EMP_ID | DEPT_NAME
6965828|Physics One
7510197|Physics One
4789042|Physics One
7991528|Physics One
I tried
#sed -(n-1) '$=' Myfile
the result is 5 however I should be 4.
Comment Responses
This is the way you want i guess:
pandeeswaran@ubuntu:~/training$ cat Myfile
EMP_ID | DEPT_NAME
6965828|Physics One
7510197|Physics One
4789042|Physics One
7991528|Physics One
pandeeswaran@ubuntu:~/training$ sed -e '1d' Myfile|sed -n '$='
4
Reply To This Comment