Log Files Management Commands
Show lines that contain a specific string (case sensitive)
grep 'STRING' /veritran/vt-net/log/ENVIRONMENT_NODE.log
Show lines that contain a specific string ignoring the case (uppercase or lowercase)
grep -i 'STRING' /veritran/vt-net/log/ENVIRONMENT_NODE.log
Look for a string in the directory
grep -r 'STRING' /veritran/ENVIRONMENT/vt-net/log/
Show the number of the lines that contain a specific string
grep -n 'STRING' /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
See the last ten lines in a file
tail /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
See the last n lines in a file
tail -N[number] /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
See new output on the log file in real time
tail -f /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
See the first ten lines in a file
head /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
See the first n lines in a file
head -N[number] /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log
Count how many times a string is repeated within a file
cat /veritran/ENVIRONMENT/vt-net/log/ENVIRONMENT_NODE.log | grep [STRING] | wc -l
Note
To see a list of commands that can be used to analyze the platform and troubleshoot possible errors, read Commands.
In this section: