going to reinstall, need some BASH advice

The other day I was in the middle of upgrading to KDE 4.4 when my computer shut down suddenly. (I think it’s due to the bad battery)

That left me with a totally screwed up and unusable system. I have /home on a separate partition so I popped in the cd and did a quick reinstall. The new installation doesn’t work quite right so I want to try again.

I have a new hd ordered for this laptop so while I’m waiting for it to arrive I want to take this opportunity to try somethings I’ve never done and perhaps learn something new.

Here is my goal: Reinstall openSUSE and end up with a default installation while keeping the data in /home intact.

My plan: use the live cd to delete all hidden files and directories from /home. Leaving only the directories containing my data.

Will deleting all the hidden stuff in /home leave the default install that I’m looking for?

What BASH command can I use to delete said directories. (rmdir only allows empty directories to be erased)

Thanks in advance for any help you can offer me.

Before the reinstall, rename your home directory, e.g.

mv /home/joe /home/joe.old

After the install, when you have created a new /home/joe, move the directories that you want back, e.g.

cd /home/joe.old
mv pictures music videos ../joe

If you are the first user in the system, both /home/joe and /home/joe.old should belong to you (id 1000). When you are satisfied you have got everything you want back, you can remove /home/joe.old.

I don’t think you really need to delete anything to get a virgin install. But the command you’re looking for will remove a file or directory recursively.

rm -Rf *dirname*

That would work better than trying to delete all setting and config files. I never thought of doing it that way. Thanks a million.

Guess I was trying to make it more complicated than need be.:slight_smile:

you need to use the rm command. but be very very careful with it. You might want to read the man pages first

man rm

you might want to use the -i or -I switch to confirm each delete.

Use .* as a filter but do a ls .* first to see if the list is what you want. Note you need to be root to see the list since these are hidden files.

On 02/14/2010 09:26 AM, linuxminded wrote:
>
> The other day I was in the middle of upgrading to KDE 4.4 when my
> computer shut down suddenly. (I think it’s due to the bad battery)
>
> That left me with a totally screwed up and unusable system. I have
> /home on a separate partition so I popped in the cd and did a quick
> reinstall. The new installation doesn’t work quite right so I want to
> try again.
>
> I have a new hd ordered for this laptop so while I’m waiting for it to
> arrive I want to take this opportunity to try somethings I’ve never done
> and perhaps learn something new.
>
> Here is my goal: Reinstall openSUSE and end up with a default
> installation while keeping the data in /home intact.
>
> My plan: use the live cd to delete all hidden files and directories
> from /home. Leaving only the directories containing my data.
>
> Will deleting all the hidden stuff in /home leave the default install
> that I’m looking for?
>
> What BASH command can I use to delete said directories. (rmdir only
> allows empty directories to be erased)
>
> Thanks in advance for any help you can offer me.
>
>
Ouch ??? If you have space on the hd, make a new partition, called
/home2/ then move what you need from /home to /home2

What you think corporations only have 1 /home partition?

I’m up and running again!

I gave /home a new name and then moved my old stuff into the new /home created by the install.

used rm -rf to delete the old /home (was always too chicken to try that particular command before) :slight_smile:

Thanks for all the help.

Gratz

You should be afraid of rm you can erase everything on the system with it. So always check 3 times before pressing enter. If you have any doubts DON’T.

On Sun, 14 Feb 2010 15:46:02 GMT, gogalthorp <gogalthorp@no-mx.forums.opensuse.org> wrote:

>
>you need to use the rm command. but be very very careful with it. You
>might want to read the man pages first
>
>man rm
>
>you might want to use the -i or -I switch to confirm each delete.
>
>Use .* as a filter but do a ls .* first to see if the list is what you
>want.

>Note you need to be root to see the list since these are hidden
>files.

Bzzt. Not the case, you can see them if you own the files/directories
and have set the appropriate environment variables or command line
switches. See ‘man ls’.

On Mon, 15 Feb 2010 16:16:02 GMT, gogalthorp <gogalthorp@no-mx.forums.opensuse.org> wrote:

>
>Gratz
>
>You should be afraid of rm you can erase everything on the system with
>it. So always check 3 times before pressing enter. If you have any
>doubts DON’T.

I nearly did just that once. Fortunately i recognized what i had done
and sought competent help. Since i stopped before much damage was done
(i had made it unbootable) recovery was straightforward. Nowdays i am
that competent help.