?
Solved

Linux rm command

Posted on 2013-11-10
8
Medium Priority
?
434 Views
Last Modified: 2013-11-10
Dear Experts,

Somehow, I found on my root directory in which it
has direcotry named ec2-user\r/ that I want
to delete it. But it can not do that by

rm -rf ec2-user\r

or
rm -rf  "ec-user\r"

Probably the directory is created by my wrong script with "\r" putting to the directory
name.

How I can I delete it

Pleaea advise
Duncan
0
Comment
Question by:duncanb7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 13

Accepted Solution

by:
duncanb7 earned 0 total points
ID: 39636825
Finally solved it by first rename it
rename $'\r' '' *
0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 39636828
it is solved suddenly on my command with rename $'\r' "" *

http://unix.stackexchange.com/questions/60779/how-do-i-remove-carriage-returns-from-directory-names
Duncan
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39636860
Just using single quotes would have been sufficient:

rm -rf  'ec-user\r'

The link you found deals with renaming, not removing (yet it helps).

Renaming can be done with single quotes as well:

mv 'ec-user\r' ec-user

wmp
0
How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

 
LVL 13

Author Comment

by:duncanb7
ID: 39636873
if it can be renamed as normal direcotry name , it is of course that  can be deleted
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39636889
Sure.

But why the extra effort of renaming before deleting when a single step is sufficient, just by using single quotes?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39636895
The thread is already closed
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39636900
I just wanted to help. Sorry for bothering you.
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39636917
Just want to reminder you the thread is closed so just worry you
did not see it. Anyway Thanks for your help
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question