Operating System - HP-UX
1752726 Members
5657 Online
108789 Solutions
New Discussion юеВ

Re: List of common mistakes

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: List of common mistakes

>#/home/sun/moon/mercury/> rm -rf ../*

This is going to fail because is is going to try deleting the current directory mercury.

>MK: Remember that every directory has two special sub-directory entries: "." and "..".
>This command will delete /home/sun/moon/*.*, which includes:
/home/sun/moon/.. = /home/sun/
/home/sun/moon/../.. = /home
/home/sun/moon/../../.. = /

Huh?

>And when "rm -rf" deletes a directory, it will also delete all files and sub-directories in it.

Yes, in it, but not the recursively to all ancestors.
Hakki Aydin Ucar
Honored Contributor

Re: List of common mistakes

I remembered a mistake I did in the past.
I issued the following command in lab server;
# hostname monster

and forgotten it , somebody call me that GUI manager application sayas no more OR valid license and logon with telnet and found my mistake:

# hostname
monster

I corrected it
# hotname

my problem I created solved
Matti_Kurkela
Honored Contributor

Re: List of common mistakes

>>#/home/sun/moon/mercury/> rm -rf ../*

>This is going to fail because is is going to try deleting the current directory mercury.

By Unix conventions, a directory is just a file (although a special type of one).

A file can be deleted while it's still open: if that's done, the file will keep existing (but it will be unreachable using any filename) as long as it's held open. As soon it's closed, it will be deleted for real.

This is true for all files, including directories.

----------

>> #/home/sun/moon/mercury/> rm -rf ../*.*
>> [...will lead to total destruction]

> Huh?
> [...] but not the recursively to all ancestors.

After a bit of thinking, I see you're correct. It will delete ../.. = /home/sun/moon, but not farther than that.

Consider me humbled, and my "rm -rf" paranoia brought back to sensible (but still sensibly paranoid) levels :)

MK
MK
Bijeesh
Respected Contributor

Re: List of common mistakes

Hi,
#/home/sun/moon/mercury/> rm -rf ../*
I agree with MK. It delete current dir (mercury) also.

And,
#/home/sun/moon/mercury/> rm -rf ../*.*
Delete the files and dirs which have a dot symbol and under moon directory.(My prev post)
But it can't delete the hidden files in moon dir(which starts with a dot, like ".abc"
Also rm -rf * cannot delete the dot(.) and double dots(..) which are indicating current dir and parent dir.
Torsten.
Acclaimed Contributor

Re: List of common mistakes

.


The most common mistake seen here in the forums is first doing anything as root even if you are absolutely not sure what you are doing (e.g. disk replacements in complex LVM structures), then ask how to solve the self-created serious problem.

PEBKAC.


Better first ask, read, confirm, then do.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Manoj1
Advisor

Re: List of common mistakes

Hi Hakki,

Do you mean fully qualified domain name with ?

#hostname

For example:
#hostname monster.abc.com

Right ??

vishnu.khandare
Respected Contributor

Re: List of common mistakes

Hi Manoj,

Its just hostname of server
#hostname server_name

This one is correct.


Regards
Vishnu Khandare
You should deserve before U desire!!!!
Steven E. Protter
Exalted Contributor

Re: List of common mistakes

Shalom,

Know thy host name.

I was just asked today what my most embarrassing mistake was in systems administration.

That was while supposedly vetting a patch set in the sandbox, actually installing it in production with reboot during business hours.


Things like that happen more often than you imagine.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Raj D.
Honored Contributor

Re: List of common mistakes

Manoj,
Also few good points:

1. Be careful about the right click , when you are using putty session(s):
It can paste all the buffer contents with a wrong right click, and can damage if you have root session open.

One example: one fine morning we found that none of the LVM commands are working. Like vgdisplay , lvdisplay , lvcreate nothing works and giving error. After reviewing we found that all the files are 0 byte.
Later found by mistake pasting of ">" character did the damage.



2. Take system config backup before any activity ,like reboot, or upgrade or scheduled maintenance or hardware upgrade :
If the config data taken prior the activity the verification would be easy after the system is backup up, and eliminates confusions. There are many scripts sysinfo, infoc , nickel collector etc are available that can quickly collect system info before any activity.



3. Track/preserver historical filesystem config data to resolve problem quickly:
Suppose you got a ticket that /var is 95% in your server.
If you have bdf output , archived offsite, %, you can easily track how much it was earlier before it is 95% , so you can take an action quickly. And troubleshooting flowchart would be simple.
- If it was earlier just 94% , so you will know only 1% increased and you will try to reduce 1% or 2% only.
- Suppose If it was 60% earlier, then you will think oh something really filled up the file system, and the hunt for large files will begin,
- Sometime application or backup/restore restores something by mistake on root or vg00 filesystems, so that can also be tracked.


for now these three ,

Enjoy, Have fun!,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Patrick Wallek
Honored Contributor

Re: List of common mistakes

1) Being in too much of a hurry to do something and making a careless mistake.

2) Panicking when something goes wrong and rushing to try to fix something when you don't know the real problem. (Management standing over your shoulder and asking 'When will it be fixed?' can be a big cause!)

3) Not reading complete error messages.

4) Not using support when there's a problem. You likely pay HP, or someone, for support. Use it. That's why you pay them.