I have log file system that renames the latest log file with current time and i must set a less command to check log file easily. I can quit less sommand with q but i must follow the latest incoming lines so after pressing shift+f q doesnt work and i need to quit with ctrl+c.
When i press ctrl+c main screen and process is being killed but terminal screen has the error that you can see below
find /data/tomcat/logs/out.* -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" " |xargs less
i can clear the error with reset but its ridiculous to use it like this. As i search on internet most of people explained it as ctrl+c kills the main command but the script doesnt respond the SIGINT. Tried a lot of them but cannot succeded on killing this simple script.
And also unable to make aliases because some of the arguments gave error but it works perfectly fine when i run this command on terminal.
I know it would be easier to use logger rotate to rename the old file and keep the latest file with the same name but its not gonna happen.