Lesson 4 of 6
Reading & Editing Files
View file contents without opening an editor. cat prints the whole file. less lets you scroll. head and tail show the beginning or end. For editing, nano is a simple terminal-based editor.
TERMINAL
# Print entire file
cat config.txt
# Scroll through a file
less long-file.txt
# Show first 10 lines
head config.txt
# Show last 10 lines
tail config.txt
# Edit with nano
nano config.txt