LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-17-2008, 09:48 AM   #1
jimmyjiang
Member
 
Registered: Jun 2006
Posts: 132

Rep: Reputation: 15
how to remove a directory name with space ?


hi,
how can I remove a directory name with space ?
drwxrwxr-x 2 oiprod oiprod 4.0k Mar 3 11:28 3
there is a space in front of "3"
thanks!
jimmy
 
Old 03-17-2008, 09:56 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Several ways, but easiest is probably
Code:
rm -r \ 3
Other options include:
Code:
rm -r " 3"
rm -r ' 3'
Try one and see. Make sure you want to delete it though! Might be best to try preceding the command with an echo, so you can see what it'll delete before it actually does:
Code:
pwc101@example:> echo rm -r \ 3
rm -r  3

Last edited by pwc101; 03-17-2008 at 09:58 AM. Reason: clarity
 
Old 03-17-2008, 10:24 AM   #3
jimmyjiang
Member
 
Registered: Jun 2006
Posts: 132

Original Poster
Rep: Reputation: 15
thanks for quick response!
 
Old 03-17-2008, 10:46 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
No problem, glad it helped
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rm: cannot remove directory `ff': Directory not empty blancs Linux - General 17 08-29-2011 01:47 PM
SED, regexp or such - remove text after space aolong Linux - General 5 03-07-2008 02:36 PM
rmdir command does not remove directory with space tsaravan Linux - Newbie 3 08-16-2005 08:45 AM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 12:44 PM
create and remove swap space cbarbot Linux - Newbie 1 04-14-2004 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:56 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
Open Source Consulting | Domain Registration