Home » Infrastructure » Unix » listing files in solaris with inode number
listing files in solaris with inode number [message #475020] Fri, 10 September 2010 17:07 Go to next message
oradbaexp
Messages: 16
Registered: January 2009
Junior Member
Hi

SunOS 5.8 Generic sparc

cat /etc/release
Solaris 8

To list the files in a directory, ls -lrt is not giving the file name and location.I gave switch "-i" , in case it is inode number,but still no file name.

Can you please suggest any other command or any work around?
OR how to convert these numbers into name and location of files?
======

ls -lrti
total 24184
5257431 -r--r--r-- 1 aptest1 aatest1 11264 Sep 16 1999 5
3160279 -r--r--r-- 1 aptest1 aatest1 11776 Sep 16 1999 3
6306007 D--------- 1 root root 0 Dec 18 2007 6
14551 p--------- 0 aptest1 aatest1 0 Mar 20 02:28 0
7354583 s--------- 0 root root 0 Sep 10 16:00 7
.
.
.

======

Thanks In advance.

Regards..
Re: listing files in solaris with inode number [message #475023 is a reply to message #475020] Fri, 10 September 2010 17:19 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
First, this has nothing really to do with Oracle, but:

How sure are you that you are not in a directory with files named "5" "3" "6" "0" and "7"

Post the FORMATTED (Read "How to format your post" section in the Forum FAQ) output of "ls -l" and "ls -li" like I did in this example, so that we can actually see which columns align:

starfury temp # ls -l
total 0
-rw-r--r-- 1 root root 0 Sep 11 00:14 bar
-rw-r--r-- 1 root root 0 Sep 11 00:14 foo
-rw-r--r-- 1 root root 0 Sep 11 00:14 hey
-rw-r--r-- 1 root root 0 Sep 11 00:15 ugh
starfury temp # ls -li
total 0
1218920 -rw-r--r-- 1 root root 0 Sep 11 00:14 bar
1218918 -rw-r--r-- 1 root root 0 Sep 11 00:14 foo
1218922 -rw-r--r-- 1 root root 0 Sep 11 00:14 hey
1218924 -rw-r--r-- 1 root root 0 Sep 11 00:15 ugh
starfury temp # 
Re: listing files in solaris with inode number [message #475024 is a reply to message #475023] Fri, 10 September 2010 17:48 Go to previous messageGo to next message
oradbaexp
Messages: 16
Registered: January 2009
Junior Member
Thanks Thomas for update.

Actually the original command is something like this

cd /proc/2345/fd
ls -lrti

====

The process 2345 is oracle concurrent manager process.So, it was supposed to list the files ( log files etc.)it is accessing. But in this server, i am not getting the names. The name of files are standard , so i am 99.99% sure that "5","3","6" might not be the name of file.

Regards..
Re: listing files in solaris with inode number [message #475025 is a reply to message #475024] Fri, 10 September 2010 17:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
> so i am 99.99% sure that "5","3","6" might not be the name of file.
bcm@bcm-laptop:~$ ls /proc/2039/fd
0  1  10  11  12  13  14  15  16  2  3	4  5  6  7  8  9
bcm@bcm-laptop:~$ ls -l /proc/2039/fd
total 0
lrwx------ 1 bcm dba 64 2010-09-10 06:41 0 -> /dev/null
lrwx------ 1 bcm dba 64 2010-09-10 06:41 1 -> /dev/null
lr-x------ 1 bcm dba 64 2010-09-10 06:41 10 -> pipe:[14791]
l-wx------ 1 bcm dba 64 2010-09-10 06:41 11 -> pipe:[14791]
lrwx------ 1 bcm dba 64 2010-09-10 06:41 12 -> socket:[15000]
l-wx------ 1 bcm dba 64 2010-09-10 06:41 13 -> /home/bcm/.cache/ubuntuone/log/syncdaemon.log
lr-x------ 1 bcm dba 64 2010-09-10 06:41 14 -> inotify
lr-x------ 1 bcm dba 64 2010-09-10 06:41 15 -> inotify
lrwx------ 1 bcm dba 64 2010-09-10 06:41 16 -> socket:[15332]
lrwx------ 1 bcm dba 64 2010-09-10 06:41 2 -> /dev/null
lr-x------ 1 bcm dba 64 2010-09-10 06:41 3 -> pipe:[14789]
lrwx------ 1 bcm dba 64 2010-09-10 06:41 4 -> /dev/null
l-wx------ 1 bcm dba 64 2010-09-10 06:41 5 -> pipe:[14789]
lr-x------ 1 bcm dba 64 2010-09-10 06:41 6 -> pipe:[14790]
l-wx------ 1 bcm dba 64 2010-09-10 06:41 7 -> pipe:[14790]
lr-x------ 1 bcm dba 64 2010-09-10 06:41 8 -> pipe:[6605]
l-wx------ 1 bcm dba 64 2010-09-10 06:41 9 -> pipe:[6605]
bcm@bcm-laptop:~$ 

Re: listing files in solaris with inode number [message #475026 is a reply to message #475025] Fri, 10 September 2010 18:08 Go to previous messageGo to next message
oradbaexp
Messages: 16
Registered: January 2009
Junior Member
ls -l /proc/2345/fd
total 54768
p--------- 0 aptest1 aatest1 0 Mar 20 02:28 0
--w------- 1 aptest1 aatest1 6181812 Jul 19 23:41 1
--w------- 1 aptest1 aatest1 21003563 Sep 10 18:04 2
-r--r--r-- 1 aptest1 aatest1 11776 Sep 16 1999 3
s--------- 0 root root 0 Mar 20 02:30 4
-r--r--r-- 1 aptest1 aatest1 11264 Sep 16 1999 5
D--------- 1 root root 0 Dec 18 2007 6
s--------- 0 root root 0 Sep 10 18:04 7
-r--r--r-- 1 aptest1 aatest1 600064 Feb 17 2004 8
-r--r--r-- 1 aptest1 aatest1 153600 Feb 17 2004 9


=====

might i am missing somewhere.

Does this have something to do with terminal size?

I gave stty column 120

Still same output.

Regards..

Re: listing files in solaris with inode number [message #475027 is a reply to message #475025] Fri, 10 September 2010 18:21 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
OK, something is seriously wrong. If it really is the dynamic /proc view, then that process would have to be running since September 1999, but Solaris 8 was only released in February 2000.

Did you do something that clobbered other files into the dynamic /proc views from some other source? Like restore some backup that was taken of the entire root directory?

That's definitely something for a Solaris person to look into.

And why is your post still not formatted?
Re: listing files in solaris with inode number [message #475028 is a reply to message #475027] Fri, 10 September 2010 18:29 Go to previous messageGo to next message
oradbaexp
Messages: 16
Registered: January 2009
Junior Member
Thanks to all

that 1999, i think shows when last time the file was modified

$uptime
6:23pm up 174 day(s), 16:11, 2 users, load average: 1.85, 2.30, 2.35

=====
So, might be some restore,backup,upgrade might have happen.But, these files are standard files with standard file names.

Regards..
Re: listing files in solaris with inode number [message #475029 is a reply to message #475028] Fri, 10 September 2010 18:38 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
The problem is, it's not really a "file", it's procfs, which shows information about running processes.

They don't have a "standard file names", they are created dynamically when a new process starts, and go away when the process ends. (also, the permissions are completely wrong as far as I can see).

This box is broken, someone has to find out who broke it and why, and I don't think you know enough to do that. So talk to whatever person is responsible for your Unix server.

Re: listing files in solaris with inode number [message #475030 is a reply to message #475029] Fri, 10 September 2010 18:50 Go to previous messageGo to next message
oradbaexp
Messages: 16
Registered: January 2009
Junior Member
Thanks Thomas

1. Yes , true.. I am a newbie. So, i dont know much Smile and seek u peoples' advices.
2. yes, true ( as far as i know ) /proc dynamically shows the processes running in OS currentlty. But inside every process (dir.), there will be other dir which shows its details.
fd dir contains files, the process is accessing. something like lsof -p command..

Please correct, if i am wrong.
it is a working box.. users still accessing.. So, may not be broken ( actually being newbie, i don't know the meaning of broken box .I apologize for that).

regards..
Re: listing files in solaris with inode number [message #475031 is a reply to message #475030] Fri, 10 September 2010 20:24 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.lmgtfy.com/?q=Linux+/proc
Previous Topic: regarding ctrl+m article in knowledge base
Next Topic: Oracle timestamp insert problem
Goto Forum:
  


Current Time: Tue Dec 17 21:26:00 CST 2024