Link to home
Start Free TrialLog in
Avatar of towo2002
towo2002

asked on

AIX 5 How to delete a folder "abc^M"

Hi all EXPERTS

Recently, I used a self custom script to extract a list of file into a folder.  Unluckily, the script is encoded in wrong because of the ascii / binary problem.  All the line ended with ^M and therefore extract it into a new folder.  e.g  "extract -xvf xxx.sar -R /abc^M"

By using ls -l, there are two folders with the same name:-
drwxr-xr-x     8     suppt    system   4096   Sep 15    23:50 abc
drwxr-xr-x     6     root       system  3584   Sep 15     23:51 abc
drwxr-xr-x     8     suppt    system   4096   Sep 15    23:50 abc.bak
drwxr-xr-x    11    suppt    system   2048   Jun 17      10:45  global

By using ls -l, like this
abc         abc.bak
              global

I wanna to delete the second line folder
"root       system  3584   Sep 15     23:51 abc"  
Any solutions?

Please advice.  Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of towo2002
towo2002

ASKER

Thanks omarfarid

It works.  Great!!!

How about if there are 2 hidden char, I've to use 2 "??" then?

Please advice, thanks.
Yes, ?? will do
Great, thanks!!!
Also useful to know is the -b option to ls.

If you do

ls -lb

it will display any unprintable characters in filenames.  This is particularly useful if a filename contains a bunch of control characters.