duncanb7
asked on
Linux rm command
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
if it can be renamed as normal direcotry name , it is of course that can be deleted
Sure.
But why the extra effort of renaming before deleting when a single step is sufficient, just by using single quotes?
But why the extra effort of renaming before deleting when a single step is sufficient, just by using single quotes?
ASKER
The thread is already closed
I just wanted to help. Sorry for bothering you.
ASKER
Just want to reminder you the thread is closed so just worry you
did not see it. Anyway Thanks for your help
did not see it. Anyway Thanks for your help
ASKER
http://unix.stackexchange.com/questions/60779/how-do-i-remove-carriage-returns-from-directory-names
Duncan