Master commands for reading file contents and searching through files and directories. Learn cat, less, head, tail, grep, and find to efficiently locate and inspect data.
Create files with sample content for viewing and searching.
cd ~mkdir search-practice && cd search-practiceecho 'Hello World' > hello.txtecho -e 'Line 1\nLine 2\nLine 3\nERROR: Something failed\nLine 5' > log.txtecho -e 'apple\nbanana\ncherry\ndate\nelderberry' > fruits.txtecho writes text to files. > creates new file. -e enables escape sequences like \n (newline). We're creating test files with known content to practice viewing and searching.
Three files created: hello.txt (1 line), log.txt (5 lines with ERROR), fruits.txt (5 lines of fruit names).