PDA

View Full Version : deleting files



Dinant
12-24-2002, 03:33 PM
How can I set Knoppix to delete files from my harddisks?

Dave_Bechtel
12-24-2002, 06:48 PM
--As root:
' mc '

--But first you have to mount your partitions read/write, so:

' fdisk -l '
' mkdir /mnt/c '
' mount /dev/hda1 /mnt/c -orw '

--Once you're in mc, ' cd /mnt/c ' - use Insert to tag files, F8 to delete them. Repeat the above steps for each partition you want to delete files on (drive D: is usually hda2 or hda5, etc and you have to have a separate mkdir (/mnt/d) for each, although you can name them whatever you want.)


How can I set Knoppix to delete files from my harddisks?

Flibble
01-04-2003, 09:55 PM
man rm

Dave_Bechtel
01-05-2003, 09:12 PM
--RM is still too dangerous for *most* people to use, including "gurus." ' mc ' gets the job done safely, and asks for confirmation. The only (halfway) safe way to run plain 'rm' on multiple files, is if you are *not root* - and even then it may take out some files that you didn't think were vulnerable.


man rm

Flibble
01-05-2003, 10:42 PM
I certainly agree that you want to be careful when you use rm, but not necessarily with the opinion that it's just too hard too use to even try. One of these days you'll find yourself on a *Nix box that doesn't have mc and then you are going to be screwed unless you know how to use the basic tools of the trade, including rm. If you are going to use it and are in anyway unsure then feel free to use the -i and -v switches to get all the information you need and a prompt before every removal. Do this enough times until you feel comfortable and then drop them. Its always a good idea to keep a regular backup of your system (man dump) so that you have something to fall back on if it all goes pear shaped irespective of your chosen deletion tool. I have no problems with anyone using whatever they need to get the job done, but I still believe that it makes sense to know basic command line tools (that includes vi I'm afraid) in the event that you find yourself on a system somewhere (and I have, many times) with nothing beyond a base install. I am not all that familiar with mc but I wager that it's also harder to include in shellscripts than rm (please feel free to correct me if I'm wrong, I like to learn ;>)

BTW, having re-read my first post I realise it looks like an RTFM post, for which I apologise. I _really_ hate when I see those, and I didn't mean it to come across that way. I thought it was easier to just point in the direction of the relevant command and let man do the rest.

Dave_Bechtel
01-07-2003, 02:17 AM
--Yea, I know what you mean about boxes with just basic installs. It's not that rm is too *hard* to use, it's too DANGEROUS. It amazes me that for as long as *nix has been around, nobody has re-written the damn thing with at least some *basic* sanity checks by default. ("Prelim results show that you are deleting over 100(0) files from the / directory, with recursion. Abort/Continue?")

--Dump doesn't work with anything but ext2 (and using it has been officially discouraged by Linus because of open / writing files.) Tar is the semi-"official" tool for backup, but it still doesn't handle ACL's (AFAIK.)

--Regardless of the fact that most home users don't back up their systems like they should (all those reading this who are guilty, raise your hands...) this is a Knoppix forum, and Knoppix includes mc. Now let me put my arm down so I can type with both hands... :roll:

--Knowing *basic* VI is undoubtedly helpful. But VI itself is a leftover from the 70's, and there are better alternatives available now. Knoppix is (kinda) for Linux newbies and ppl who can see its potential; if all you have is a basic install, it's always good to carry a floppy/cdr around with some GNU tools tarballed on it. :)

--I haven't tried running mc through a script, altho it may be worth looking into. It's more of an interactive environment, with menus.

--Thanks for the sentiment though, and for being sensitive to how things might come across. Lots of newbies get turned off on Linux by 1337 "RTFM" snobs on other forums; I try my best to encourage ppl to learn like I did; by researching the Web, reading books, and asking other users about stuff on forums like this one. Any help is appreciated. 8)


I certainly agree that you want to be careful when you use rm, but not necessarily with the opinion that it's just too hard too use to even try. One of these days you'll find yourself on a *Nix box that doesn't have mc and then you are going to be screwed unless you know how to use the basic tools of the trade, including rm. If you are going to use it and are in anyway unsure then feel free to use the -i and -v switches to get all the information you need and a prompt before every removal. Do this enough times until you feel comfortable and then drop them. Its always a good idea to keep a regular backup of your system (man dump) so that you have something to fall back on if it all goes pear shaped irespective of your chosen deletion tool. I have no problems with anyone using whatever they need to get the job done, but I still believe that it makes sense to know basic command line tools (that includes vi I'm afraid) in the event that you find yourself on a system somewhere (and I have, many times) with nothing beyond a base install. I am not all that familiar with mc but I wager that it's also harder to include in shellscripts than rm (please feel free to correct me if I'm wrong, I like to learn ;>)

BTW, having re-read my first post I realise it looks like an RTFM post, for which I apologise. I _really_ hate when I see those, and I didn't mean it to come across that way. I thought it was easier to just point in the direction of the relevant command and let man do the rest.

Flibble
01-07-2003, 08:55 AM
"--Dump doesn't work with anything but ext2 (and using it has been officially discouraged by Linus because of open / writing files.) Tar is the semi-"official" tool for backup, but it still doesn't handle ACL's (AFAIK.)"

Ha ha, you caught me. Its been a while since I did a "real" backup. I don't deal with our *Nix boxes anymore, and my Linux boxes are small enough (and my network disk capacity large enough) that I can get away with just DD'ing them up onto the LAN. Plus I then get to play around with them using TASK and Autopsy (@stake for details).

Better alternatives to vi? That's a troll if ever I saw one. ;>

I like the idea of carrying around a CDR with the tarballs, but again, I can probably find you at least 10 machines in here that don't have a compiler on them. No, I don't know why either. ;>

This thread just highlights one of the beauties of Nix, there is no such thing as the One True Way, find what works for you and go with it, leaving yourself open to the possibilities that there are other ways to do what you do.