1752795 Members
6009 Online
108789 Solutions
New Discussion юеВ

Re: ls -l error

 
SOLVED
Go to solution
Sunny Jaisinghani
Trusted Contributor

ls -l error

Hello All,

I came across a strange scenario. When i do a long listing on a directory it gives me the files.
However, when i do long listing on a file in that directory, it says no file found.


#pwd
/u02/TST/olapex

#ls -ltr
total 17204
-rwx------ 1 oratst dba 209117 Oct 30 06:56 FPAPJP.eif
-rwx------ 1 oratst dba 8485638 Oct 30 07:38 ODPCODE.eif
-rwx------ 1 oratst dba 2247440 Oct 30 07:39 XWDEVKIT.eif
-rwx------ 1 oratst dba 6610847 Oct 30 07:42 ZPBCODE.eif

#ll ZPBCODE.eif
ls: ZPBCODE.eif: No such file or directory


I tried creating a new file and list it. It works fine. But the above 4 files seem to be nonexistent.

These files are under a local FS and i am working under the directory /u02/TST/olapex

I am not able to figure out the issue here.

Please help

Sunny
9 REPLIES 9
Lovro VRES
Advisor
Solution

Re: ls -l error

Hello,

is it possible that there are some "hidden" character in the name of the file, so the real name is not only the name you can see.

Try ls -l | xd or ls -l | xd -c and you will be able to seeif there is any special character.

Also using bash can help.

Regards,
Lovro
R.K. #
Honored Contributor

Re: ls -l error

Hi..

May be these filenames contain some special character.
Try with:
# ll ZPBCODE*
Don't fix what ain't broke
Sunny Jaisinghani
Trusted Contributor

Re: ls -l error

I am using bash shell.

Yes, you both are right... the filename has special characters.


#ls -l ZPBCODE.eif*
-rwxrwxrwx 1 orabig dba 6610847 Nov 5 07:42 ZPBCODE.eif


ls -l | xd doesn't work

what is xd. There is no man page for xd.

How can i find out the special characters in the filename.

Sunny
V. Nyga
Honored Contributor

Re: ls -l error

Hi,

check the man pages 'man ls':
Options:
-b List nonprinting characters in the octal \ddd notation.

So use 'ls -b'

Another possibility is the file manager.
It shows such characters, too.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
V. Nyga
Honored Contributor

Re: ls -l error

Or:

-q List nonprinting characters in file names as the character (?).

V.
*** Say 'Thanks' with Kudos ***
Sunny Jaisinghani
Trusted Contributor

Re: ls -l error

#ls -lb
total 17200
-rwxrwxrwx 1 orabig dba 209117 Nov 5 07:42 FPAPJP.eif\
-rwxrwxrwx 1 orabig dba 8485638 Nov 5 07:42 ODPCODE.eif\
-rwxrwxrwx 1 orabig dba 2247440 Nov 5 07:42 XWDEVKIT.eif\
-rwxrwxrwx 1 orabig dba 6610847 Nov 5 07:42 ZPBCODE.eif\


#ls -lq
total 17200
-rwxrwxrwx 1 orabig dba 209117 Nov 5 07:42 FPAPJP.eif
-rwxrwxrwx 1 orabig dba 8485638 Nov 5 07:42 ODPCODE.eif
-rwxrwxrwx 1 orabig dba 2247440 Nov 5 07:42 XWDEVKIT.eif
-rwxrwxrwx 1 orabig dba 6610847 Nov 5 07:42 ZPBCODE.eif

V. Nyga
Honored Contributor

Re: ls -l error

Hi again,

there seems to be a ' ' (space) at the end.
Do you have an application which takes access to these files?
Else you can rename it or leave it as it is.

V.
*** Say 'Thanks' with Kudos ***
Dennis Handly
Acclaimed Contributor

Re: ls -l error

>ls -l | xd doesn't work

You need "xd -c". Or you can use vis: ll | vis -t

Or as Volkmar said, use "ls -b".

>what is xd? There is no man page for xd.

Sure there is, right there with od(1):
http://docs.hp.com/en/B2355-60130/od.1.html
Sunny Jaisinghani
Trusted Contributor

Re: ls -l error

Thanks everyone.

There was a blank space after the filename