Reading and Editing
Reading files
Section titled “Reading files”| Command | Description | Example |
|---|---|---|
cat | Display the full content | cat file.txt |
less | Read page by page | less file.txt |
head | Display the first 10 lines | head file.txt |
tail | Display the last 10 lines | tail file.txt |
tail -f | Follow changes in real time | tail -f log.txt |
Editing files
Section titled “Editing files”nano file.txt→ simple, intuitive editor.vim file.txt→ advanced, powerful editor with a steep learning curve.
Best Practices
Section titled “Best Practices”- Use
lessinstead ofcatfor long files. - Use
tail -fto monitor logs in real time. - Start with
nanobefore diving intovim.