Chapter 4: Linux Advanced Commands
Common Mistakes I See Students Make
- Using
sed -iwithout testing first and corrupting a config file. Test without-i, or use-i.bak. sudo echo "x" > /etc/file— fails with Permission denied. Useecho "x" | sudo tee /etc/file.- Starting a service but not enabling it, so it is gone after reboot. Use
sudo service <name> startandsudo systemctl enable <name>. - Forgetting that the app is listening on 127.0.0.1 and wondering why it is not reachable from the browser — that is actually correct behind a reverse proxy.
- Editing
/etc/fstaband rebooting withoutsudo mount -a. One typo can stop the instance from booting. - Cron jobs using relative paths or
%without escaping. - Scripts without
chmod +xor with Windows line endings (CRLF) — fix withsed -i 's/\r$//' script.sh.