LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-13-2005, 10:11 AM   #1
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
How to delete non-empty directories? Also have a terminal question


Hi people, I have 2 problems here that I need help with.

1. I have a directory that I want to delete. Normally, I would just use this using Nautilus or something, but I'm having permission denied errors so I can't. The problem is, the directory isn't empty. It has other directories in it, which are probably not empty themselves (I haven't checked, there are quite a few). I tried

Code:
$ rmdir --ignore-fail-on-non-empty webmin-1.210
but this didn't seem to do anything. I then did

Code:
$ cd webmin-1.210
$ rm *
and that went through each file individually asking me if I wanted to delete. There were many files, so it goes without saying that this took a while! Of course, rm didn't delete the directories.

How then do I delete a directory and all its contents? I'm getting a bit confused by things in the man pages for rm and rmdir.

2. If I load GNOME or Xfce (and probably some of the other window managers I have installed, I haven't tried them all) and open a terminal, the prompt says "bash-3.00$". It wasn't always like this. If I load FVWM, the prompt says "nick@nick:~$" and that's what I used to have in GNOME. How do I get it back to that?

Any help appreciated, thanks.
 
Old 07-13-2005, 10:26 AM   #2
mhallbiai
Member
 
Registered: Jun 2005
Posts: 96

Rep: Reputation: 15
1. using forceful, recursive delete should clear up this problem
Code:
rm -rf webmin-1.210/*
if you also want to delete the webmin-1.210 directory drop the * (rm -rf webmin-1.210/)

2. not sure on this one so i will leave it to another

hope this helps
 
Old 07-13-2005, 10:27 AM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
rm -rf *

http://www-128.ibm.com/developerwork.../l-tip-prompt/
 
Old 07-13-2005, 10:31 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Thanks both of you!
 
Old 07-13-2005, 06:51 PM   #5
Diademed
Member
 
Registered: Jul 2004
Distribution: Slackware 10.2
Posts: 159

Rep: Reputation: 30
Quote:
Originally posted by Andrew Benton
rm -rf *

http://www-128.ibm.com/developerwork.../l-tip-prompt/
Umm... Careful there....

Make sure you are in the correct directory when you issue that command.
 
Old 07-14-2005, 01:55 AM   #6
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Your prompt is based on the PS1 variable, echo it to see what it is currently set at. You can export it from .bashrc, check out an online guide for the various syntax and coloring available for this.
 
Old 07-14-2005, 02:17 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
"echo PS1" gives me "\s-\v\$" in Xfce and "\u@\h:\w\$" and FVWM2. It's not that difficult to tell what they mean. Why is there a difference though? I use bash in both Xfce in FVWM2 :/. I don't have a .bashrc file, it isn't in my home directory (the only file in there relating to bash is .bash_history). Doing a "locate .bashrc" comes up empty too.

Thanks.
 
Old 07-14-2005, 08:13 PM   #8
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
When you are in the different window managers do you have different terminal prompts?
You might want to try creating the .bashrc file, putting in your export call, and seeing if it registers that each time you open a new terminal.
Basically though, you just need to export PS1 to what you want your terminal to be.
 
Old 07-15-2005, 12:21 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Quote:
Originally posted by Vgui
When you are in the different window managers do you have different terminal prompts?
Yes.

Quote:
You might want to try creating the .bashrc file, putting in your export call, and seeing if it registers that each time you open a new terminal.
Basically though, you just need to export PS1 to what you want your terminal to be.
What does it look like?

Code:
EXPORT $PS1 = \u@\h:\w\$
Like that maybe? Perhaps with a semi-colon at the end too?

Thanks again.
 
Old 07-15-2005, 07:40 PM   #10
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Code:
        #set terminal prompt
        export PS1='\e[0m[\#-\t] \w>\e[32m '
Replace as needed, but that should do the trick (or have an affect).
 
Old 07-16-2005, 12:51 AM   #11
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Yep, it's ok now. Thanks a lot .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to search for and delete empty directories? BrianK Programming 4 06-03-2005 08:24 AM
Removing non-empty directories brunnopessoa Linux - Newbie 8 11-13-2003 08:56 PM
how do I remove all empty directories? noisybastard Linux - General 2 08-11-2003 12:47 AM
Delete Empty files whospeaks2me Linux - Newbie 2 07-18-2003 11:39 PM
finding empty directories... PokerFace Linux - General 2 10-16-2002 09:23 AM


All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration