Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> echo "/dev/sda1 /mnt/dev ext4 defaults 0 0" | sudo tee -a /etc/fstab

> If this is run again, you’ll end up having duplicate entries in your /etc/fstab

You could also just add a space in front of a command you don't to accidentally run later. This will not store it in .history



Perhaps you conflated /etc/fstab with $HOME/.bash_history? Because for sure that "sudo tee -a" will cheerfully append its stdin to the named file each time it is run, at least until you run out of disk space


Seems to me findmnt has the proper helpers for checking. But, I would recommend a systemd mount unit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: