1753912 Members
8573 Online
108810 Solutions
New Discussion юеВ

Re: file not found

 
SOLVED
Go to solution
Avijit Sahoo
Occasional Contributor

file not found

Hi all,

I have a doubt in ls command.
In '/var/stm/logs' directory, When i run 'ls -al' : all dir and files are showing but it says tool_stat.txt is not found.

Again I run only 'ls' command under the same directory, all are shown inclusing the tool_stat.txt file.

Please clarify my doubt, why is it so?

What does tool_stat.txt file do?

Thanks in advance
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: file not found

There may be some non-printable characters in the file name.

Try running:

# ls -lb

And see what shows up.
Avijit Sahoo
Occasional Contributor

Re: file not found

That means you sat that ls and ls -al command output for a particular fle is different. I mean it will show in ls command and not in ls -al. FYI only one file is there in that directory.

2. What does tool_stat.txt do?
Dennis Handly
Acclaimed Contributor

Re: file not found

>When I run 'll -a': all dir and files are showing but it says tool_stat.txt is not found.
>I run only 'ls' command under the same directory, all are shown including the tool_stat.txt file.

ll(1) does a stat(2) on each file. So if there is something wrong with tool_stat.txt, you'll see it. If your directory has read but not execute access, you can see the files with ls(1) but not ll(1) but you said you saw other files.

So you could try cksum on tool_stat.txt.
Avinash20
Honored Contributor
Solution

Re: file not found

tool_stat.txt shows the tools Statistics on how many time the tools have been run and when was the last time it was run

I tried to simulate the same in our LAB server

#ls -la
total 144
..
..-rw-r--r-- 1 root sys 763 Jan 8 13:23 conlog.log
drwxr-xr-x 2 root root 96 Jan 8 03:54 decode
drwxr-xr-x 2 root other 96 Feb 1 19:51 monitor
drwxr-xr-x 2 root root 8192 Feb 1 19:50 os
drwxr-xr-x 2 root sys 96 Feb 1 19:41 sys
-rw------- 1 root root 0 Feb 1 20:54 tool_stat.txt
..
..

#ls -al tool_stat.txt
tool_stat.txt not found


#ls -al tool_stat.txt*
-rw------- 1 root root 0 Feb 1 20:54 tool_stat.txt

#ls -bl tool_stat.txt*
-rw------- 1 root root 0 Feb 1 20:54 tool_stat.txt\032

You could see \032 added which is ^Z.

You could try to move the file via

#mv tool_stat.txt* tool_stat.txt
#ll tool_stat.txt
# ls tool_stat.txt

Also note the permission of tool_stat.txt is

-rw-rw-rw- 1 root root

PS: Please assign points if you find your answers
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
bright image
Frequent Advisor

Re: file not found

If the filename has unprintable characters in it you can also move it with the following procedure:

$ ls -i /var/stm/logs
6341 conlog.log 6336 monitor 6342 pvsuinitlog 39368 tool_stat.txt 6411 ui_activity_log
32287 decode 6403 os 6343 sys 6348 tools 32318 utilities


This will give you the inode number of tool_stat.txt

In this example it is 39368

Then run

find /var/sym/logs -inum 39368 -exec mv {} tools_stat.txt +

This will move the file for you.