I’ve got log file, which I would like to have 60 lines in.
When there will appear 61 line, script should cut line from beginning and paste it at end of my backup log file.
But I have not any idea how to do that. Can you help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a combination of:
tail --lines=60 my_logto get the last 60 lines of your log filehead --lines=-60 my_logto get all but the last 60 lines of your log fileI’m sure you can figure the rest out 🙂