PINE64
Simple Unixy mistakes that will ruin your day - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: General (https://forum.pine64.org/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.pine64.org/forumdisplay.php?fid=74)
+--- Thread: Simple Unixy mistakes that will ruin your day (/showthread.php?tid=12573)



Simple Unixy mistakes that will ruin your day - KC9UDX - 12-20-2020

Since it's expected that most everyone here is using a Unix or Linux, and there seem to be a lot of users new to the idiom here, I thought it would be nice to have a thread of pitfalls to be aware of.  Experienced users have all been down this road many times.  If you have one or more to contribute, please do.

I'll start with one I ran into recently.  It caused a several-day headache.  Firefox was randomly crashing, and the only thing that would remedy it was to kill ypbind, a rather odd situation.  This was caused by a simple oversight on my part.  In /etc/nsswitch.conf I had the line

Code:
hosts:        files nis dns
where I should have had
Code:
hosts:        files dns nis

I've written a pretty extensive web server, but I've never written a web browser, and can only guess why this is relevant.  So I won't propose a possible explanation.


RE: Simple Unixy mistakes that will ruin your day - Arwen - 12-20-2020

Another thing is re-direction. Some people mis-type the output file and wonder why their root file system is full;
Code:
# MiscCommand >/dev/nul
Note that it really "/dev/null" with 2 el's.



Next is the dreaded mis-identification of devices. With Pinebook Pro, their are 2 MMC devices, the internal eMMC and the Micro SD card. In most Linux kernels they show up with the same prefix, but different unit numbers, That's because they use the same driver, "mmcblk". However, getting the unit number wrong for writing could lead to over-writing your working OS.


RE: Simple Unixy mistakes that will ruin your day - KC9UDX - 12-20-2020

My personal biggest mistake is not double checking the command before hitting "return".



I've accidentally done
Code:
rm -R / intended-dir
and the like, just enough times to be now ever mindful of it.

For some reason when I type fast, I insert spaces and mix up . / and space.


RE: Simple Unixy mistakes that will ruin your day - dgdimick - 01-29-2021

(12-20-2020, 08:33 PM)KC9UDX Wrote: My personal biggest mistake is not double checking the command before hitting "return".



I've accidentally done
Code:
rm -R / intended-dir
and the like, just enough times to be now ever mindful of it.

For some reason when I type fast, I insert spaces and mix up . / and space.

You haven't lived until you've done a
"rm -rf /*.*"
Makes your day so much fun..


RE: Simple Unixy mistakes that will ruin your day - KC9UDX - 01-29-2021

Isn't it funny how that's always the time when the system just refuses to respond to Ctrl-C?


RE: Simple Unixy mistakes that will ruin your day - RTP - 01-29-2021

Here's one:

Typo on the dd command where you accidentally use 'of=/' where you mean to use 'if=/' overwriting your entire root directory

dd is one to be careful with! Wink


RE: Simple Unixy mistakes that will ruin your day - dgdimick - 01-29-2021

(01-29-2021, 03:00 PM)RTP Wrote: Here's one:

Typo on the dd command where you accidentally use 'of=/' where you mean to use 'if=/' overwriting your entire root directory

dd is one to be careful with! Wink

Please don't even mention that again, I still softly cry myself to sleep over that one.


RE: Simple Unixy mistakes that will ruin your day - Zebulon Walton - 02-01-2021

Linux adheres to the Unix Philosophy - it gives the user enough rope to hang himself. Always remember, it will do what you tell it to do, not what you want it to do! Smile