Sponsored Content
Top Forums Shell Programming and Scripting How can I get only FileName associated with a INODE on Unix much faster? Post 302478409 by frank_rizzo on Tuesday 7th of December 2010 11:42:29 PM
Old 12-08-2010
you must have missed my "assuming the file is on /" comment.

try
Code:
time find /export -inum 2590784  -xdev -print 2>/dev/null

you can also add -fstype ufs (or whatever your using) to avoid traversing the proc file system. your searching my inode so if you use / it will search all file systems. I suggest you limit your search to the file system that has your file.

Last edited by frank_rizzo; 12-08-2010 at 12:48 AM.. Reason: add comment
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX Filename length restrictions?

Can anyone help me out with information on the filename length restrictions in UNIX? Thanks! (2 Replies)
Discussion started by: xmeh
2 Replies

2. Solaris

How to map a disk block to filename/ Inode

Hi, I want to find out a particular disk block belong to which file. in solaris 2.8 Can anyone help. Thanks and Regards Bala (1 Reply)
Discussion started by: Balamurugan
1 Replies

3. UNIX for Dummies Questions & Answers

SCO Unix inode structure.

I have read quite a few threads here about the unix file creation date. I was interested in finding how to display it using a unix command. find did not help me so i looked at man inode. I found direction to htino.h which is described as the structure of the inode for S51K (UNIX), HTFS, EAFS... (4 Replies)
Discussion started by: rbn
4 Replies

4. UNIX for Dummies Questions & Answers

unix file system V filename limit

Why unix system V has a filename size limit of 14 characters.How other versions of Unix got around this problem.Can anybody help? (7 Replies)
Discussion started by: admirer
7 Replies

5. AIX

How to get the filename of which has been deleted if I know the inode number?

How to get the filename of which has been deleted if I know the inode number. i can use the command "istat" to get the inode number of the file. # istat /proc//fd/x If this file has been deleted,but the process of this file has not been closed and handle has not been released ,so this... (3 Replies)
Discussion started by: JoyOnLine
3 Replies

6. UNIX for Dummies Questions & Answers

inode filename

can someone please tell me why is the filename not inlcuded in the inode of the file? (2 Replies)
Discussion started by: wowman
2 Replies

7. UNIX for Dummies Questions & Answers

UNIX command to get inode's tid and pid

Hi everyone, I am new here in www.unix.com, i found this site because I am looking for an answer to this problem of mine. I need to know a UNIX command to display an inode's thread id and process id. Hope someone can help me on this. Thanks :D (8 Replies)
Discussion started by: rodkun
8 Replies

8. UNIX for Dummies Questions & Answers

How to get redirected filename inside unix script

Hi All, I am having a script which calculate checks the input feed and perform some function. When i am executing this script i am redirecting this to a output file. I want to know the redirected output file name inside my scripts. Is there is any way to get that . like the same way we... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. Shell Programming and Scripting

Filename check in UNIX

Hello , I have to search for the file names which will either has ABC_DEF or NN in their filename Please note that both cannot appear in the same file name currently I am using ls -lrt /zthetl/SrcFiles/*ABC_DEF*.xls| head -1 | nawk '{print $9}' How to combine the NN in this code?... (4 Replies)
Discussion started by: Pratik4891
4 Replies

10. Shell Programming and Scripting

UNIX script to display the filename

Hi All How to answer the below interview question.. With a path and filename of "/mydir1/mydir2/mydir3/myfilenane.dat" write a UNIX script to display the filename (2 Replies)
Discussion started by: shumail
2 Replies
ttysrch(4)							   File Formats 							ttysrch(4)

NAME
ttysrch - directory search list for ttyname DESCRIPTION
ttysrch is an optional file that is used by the ttyname library routine. This file contains the names of directories in /dev that contain terminal and terminal-related device files. The purpose of this file is to improve the performance of ttyname by indicating which subdirec- tories in /dev contain terminal-related device files and should be searched first. These subdirectory names must appear on separate lines and must begin with /dev. Those path names that do not begin with /dev will be ignored and a warning will be sent to the console. Blank lines (lines containing only white space) and lines beginning with the comment character "#" will be ignored. For each file listed (except for the special entry /dev), ttyname will recursively search through subdirectories looking for a match. If /dev appears in the ttysrch file, the /dev directory itself will be searched but there will not be a recursive search through its subdirectories. When ttyname searches through the device files, it tries to find a file whose major/minor device number, file system identifier, and inode number match that of the file descriptor it was given as an argument. If a match is not found, it will settle for a match of just major/minor device and file system identifier, if one can be found. However, if the file descriptor is associated with a cloned device, this algorithm does not work efficiently because the inode number of the device file associated with a clonable device will never match the inode number of the file descriptor that was returned by the open of that clonable device. To help with these situations, entries can be put into the /etc/ttysrch file to improve performance when cloned devices are used as terminals on a system (for example, for remote login). However, this is only useful if the minor devices related to a cloned device are put into a subdirectory. (It is important to note that device files need not exist for cloned devices and if that is the case, ttyname will eventually fail.) An optional second field is used in the /etc/ttysrch file to indicate the matching criteria. This field is separated by white space (any combination of blanks or tabs). The letter M means major/minor device number, F means file system identifier, and I means inode number. If this field is not speci- fied for an entry, the default is MFI which means try to match on all three. For cloned devices the field should be MF, which indicates that it is not necessary to match on the inode number. Without the /etc/ttysrch file, ttyname will search the /dev directory by first looking in the directories /dev/term, /dev/pts, and /dev/xt. If a system has terminal devices installed in directories other than these, it may help performance if the ttysrch file is created and con- tains that list of directories. EXAMPLES
Example 1: A sample display of /etc/ttysrch command. A sample /etc/ttysrch file follows: /dev/term MFI /dev/pts MFI /dev/xt MFI /dev/slan MF This file tells ttyname that it should first search through those directories listed and that when searching through the /dev/slan direc- tory, if a file is encountered whose major/minor devices and file system identifier match that of the file descriptor argument to ttyname, this device name should be considered a match. FILES
/etc/ttysrch SEE ALSO
ttyname(3C) SunOS 5.10 23 Feb 1994 ttysrch(4)
All times are GMT -4. The time now is 02:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy