LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   del file (https://www.linuxquestions.org/questions/linux-software-2/del-file-97906/)

csosa 09-28-2003 02:02 PM

del file
 
how do I delete a file in the terminal? what's the command?

trickykid 09-28-2003 02:04 PM

rm

christer 09-28-2003 02:04 PM

rm would be to 'remove' a file. That's what I use.

csosa 09-28-2003 02:06 PM

I'm trying to delete a directory.. if I use rm I get the following error: cannot remove directory `plugins': Is a directory... is there another command I can use?

megaspaz 09-28-2003 02:08 PM

to delete a directory use:

rm -r directory_name

that will prompt you with an "are you sure" type of message.

use:

rm -rf directory_name

if you don't want to be prompted and want to force a deletion.

trickykid 09-28-2003 02:10 PM

You should have told us its a directory.

If its empty with no files within the directory, use the rmdir command.

If you have files in the directory and want to remove all of them and the directory, use: rm -rf

But be careful when using rm-rf as if you make a mistake, you can delete your whole system as this forces the removal with no questions asked. For example:

rm -rf / home/user/somedir

Notice the space after the first / and home, that would remove your whole filesystem since it would think your deleting / instead of /home/user/somedir

csosa 09-28-2003 02:12 PM

ok thnks that worked.. now how do I create a directory?

megaspaz 09-28-2003 02:14 PM

mkdir directory_name

mkdir /home/user/music

will create a directory named music in /home/user/

csosa 09-28-2003 02:18 PM

where can I find a list of commands for the terminal? I want to learn how to do several thing..

megaspaz 09-28-2003 02:20 PM

sticky thread in linux general:

http://www.linuxquestions.org/questi...threadid=15837

mossy 09-28-2003 02:24 PM

Tips for beginners:
1) get a cheapo linux book on sale somewhere in the "get rid of section" of the bookstore.
2) learn the easy stuff like mkdir, rmdir, adduser etc from that - ie read the book and use it for references.
3) man pages are at your fingertips - try these:
man mkdir
man adduser

It's is always worth having a good Linux book too for references - you WILL use it and it can save you alot of time searching the net for silly stuff.

Between me and my roomate we have about 15 bloody Linux/Unix books - tonnes of resources - REALLY helpful.

mossy

christer 09-28-2003 02:27 PM

Yeah, I've got an old 486 with some old perhistoric distro on it that I would practice with and I actually had setup as a router/firewall for my local LAN. If it's an old POS machine you can mess w/ it w/o worrying about things.

...I did however fry a video card once in Linux. I was playing with the video settings & must have set the sucker too high. Oops. :)

mossy 09-28-2003 02:30 PM

heh heh heh


All times are GMT -5. The time now is 12:22 AM.