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
less
instead ofcat
for long files. - Use
tail -f
to monitor logs in real time. - Start with
nano
before diving intovim
.