Operating System - HP-UX
1834312 Members
2217 Online
110066 Solutions
New Discussion

Different kind of problem

 
Gnananandhan
Frequent Advisor

Different kind of problem

Hi experts,
Please see the attachment for the o/p of command -- ll -- The first file is a special charecter file and has a link file created for it. If I give any other command it is displaying in special symbols- which in not human readable form.
Is their a way to remove this file alone.
Thanks,
Gnana A.
If there is a better way to do it, find it !
5 REPLIES 5
Stefan Farrelly
Honored Contributor

Re: Different kind of problem


In the dir where this file is do an>

rm -i ./*

And when it lists your file with control characters answer Y to remove it. Answer N to the other files so you dont remove them.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Gnananandhan
Frequent Advisor

Re: Different kind of problem

No, any command other than `ll *|more` will result in symbols also the command prompt will be displayed in symbols only.
If there is a better way to do it, find it !
Stefan Farrelly
Honored Contributor

Re: Different kind of problem


Do the following commands;

ls -li | vis

This will list the files and show special or control characters with a \ first. What we are looking for is the inode number of the file you want to delete, eg;

> ls -li
total 10
145 -rwx------ 1 ops_sf users 47 May 27 08:36 go
140 -rw------- 1 ops_sf users 2268 May 26 18:18 nohup.out
51 drwx------ 2 ops_sf users 96 May 23 14:55 nsmail

Lets say we want to delete the file nohup.out, its inode number is 140. Now use the find command to remove by inode number;

find . -inum 140 -exec rm {} \;


Im from Palmerston North, New Zealand, but somehow ended up in London...
Thierry Poels_1
Honored Contributor

Re: Different kind of problem

Hi,

if you like "some" typing work : :)

ls > /tmp/list
ed /tmp/list
,l (this will list the file without translating special chars, search for the file with some escape codes in front of it)
q


rm -i *xxxxx* (replace xxxx with the readable part of the filename)

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Gnananandhan
Frequent Advisor

Re: Different kind of problem

Thanks all,
I worked out the solution in this way.
1.Copied all files to a tmp directory.
2.Tried rm -i * ( since it is a special file - I assumed it will the first file prompted for deletion and marked as Y, and for other things I gave N)
3. This worked, So I repeated the same process in the original directory.

Thanks Again.
Gnana A.
If there is a better way to do it, find it !