Title: Practice using less and it’s different options
Time: 5-10 minutes
Purpose: The less command is a quite a powerful tool for viewing files but apart from scrolling up and down it can do much more with the various commands to help you quickly navigate a file while you analyse its contents.
Introduction:
In our demo we had a play with less to scroll up and down a file. But often you need a bit more than just scrolling up and down when you’re analysing a file. How about searching for a string in a file or bookmarking a location where you found an error so you can go back to that position in a file quickly? These are things that you can do with the less command as well.
Activity:
- Search for a specific string in a log file using
less. - ( Extra ninja points
) Bookmark the position in the log file where you found the text with the mcommand and use the'to go back to that position.