Product SiteDocumentation Site

4.2.10.6. Querying for File Information

The file-information tags hold data on the files within the package payload, that is, the files the rpm command installs when you install the package. These tags are arrays, with one value per file.
Table 5-5 lists the file-information tags.
Table 5-5 File-information query tags
Tag
Holds
OLDFILENAMES
Array of full file names, used in older packages
FILESIZES
Array of sizes for each file
FILEMODES
Array of permissions for each file
FILERDEVS
Array of rdev values for each file
FILEMTIMES
Array of modified times for each file
FILEMD5S
MD5 checksum for each file
FILELINKTOS
Array of link information for each file
FILEFLAGS
Array of flags for each file
FILEUSERNAME
Array of user names for the file owners
FILEGROUPNAME
Array of group names for the file owners
FILEDEVICES
Array of devices for each file
FILEINODES
Array of inodes for each file
FILELANGS
Array of language flags for each file
DIRINDEXES
Array of values that matches the DIRNAMES with the BASENBAMES
BASENAMES
Array of file base names
DIRNAMES
Array of directories that matches up with BASENAMES
The OLDFILENAMES tag is used when the files are not compressed, when the REQUIRENAME tag does not indicate rpmlib(CompressedFileNames).
The FILESIZES tag specifies the size of each file in the payload, while the FILEMODES tag specifies the file modes (permissions) and the FILEMTIMES tag holds the last modification time for each file.
The BASENAMES tag holds an array of the base file names for the files in the payload. The DIRNAMES tag holds an array of the directories for the files. The DIRINDEXES tag contains an index into the DIRNAMES for the directory. Each RPM must have either OLDFILENAMES or the triple of BASENAMES, DIRNAMES, and DIRINDEXES, but not both.
When listing file information, use the square bracket array syntax with your query formats. You can use the perms special formatting option for the file modes. For example:
$ rpm -q --qf "[%-15{=NAME} %-36{FILENAMES} %{FILEMODES:perms}\n]" jikes
jikes /usr/bin/jikes -rwxr-xr-x
jikes /usr/doc/jikes-1.18/license.htm -rw-r--r--
jikes /usr/man/man1/jikes.1.gz -rw-r--r--