Ravindra BagaleCourses & study guides

Chapter 4: Linux Advanced Commands

Common Mistakes I See Students Make

  • Using sed -i without testing first and corrupting a config file. Test without -i, or use -i.bak.
  • sudo echo "x" > /etc/file — fails with Permission denied. Use echo "x" | sudo tee /etc/file.
  • Starting a service but not enabling it, so it is gone after reboot. Use sudo service <name> start and sudo 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/fstab and rebooting without sudo mount -a. One typo can stop the instance from booting.
  • Cron jobs using relative paths or % without escaping.
  • Scripts without chmod +x or with Windows line endings (CRLF) — fix with sed -i 's/\r$//' script.sh.