Find Hidden IFS Files
November 17, 2010 Ted Holt
Everybody knows that the Work with Links (WRKLNK) command lists all the files (including subdirectory entries) in an IFS directory, right? Well, to quote Ira Gershwin, it ain’t necessarily so. Your system may have IFS files that you don’t know about.
One of the UNIX conventions that the IFS has inherited is that files whose names begin with a period (“dot”) are considered to be hidden. By default, their names are omitted in directory listings. Hidden files are commonly used for system files, configuration files, and temporary files. But there’s nothing to stop other people from beginning file names with a dot. I have heard that people of nefarious intentions use hidden files to store things in unauthorized places.
One of the usual hidden files that you should get acquainted with is .profile (dot profile). The system executes the commands in this file whenever you start a Qshell session. Place .profile in your home directory. The typical use of .profile is to set environment variables and shell options.
Other applications may also create hidden files. For example, my home directory has a .eclipse directory because of my use of Websphere Development Studio.
Two hidden directories are . and .. (dot and dot-dot). Dot is a link to the directory that contains it. Dot-dot is a link to the parent directory. You can reference these directory names when it suits your purpose. Here are two examples from Qshell.
cd .. cp abc.dat ./backup/abc.bak
The first command changes the current directory to the parent of the current directory. That is, it navigates up one level in the directory tree. The second command copies file abc.dat (in the current directory) to file abc.bak in the backup directory that is found one level below the current directory.
As for finding these files, here are two ways. First, use the WRKLNK command with Display Option *ALL.
The default value of DSPOPT is *PRV, which means use the setting–*USER or *ALL–from the last time you ran WRKLNK.
In Qshell, use the –a option to see hidden files.
I need to share one last bit of information. IFS files also have an attribute–PC_HIDDEN–that you can change with the CHGATR (Change Attribute) CL command or Qshell’s attr command. This attribute has nothing to do with the first character of a file name. That is, a file named with an initial dot may have the PC_HIDDEN attribute, and a file that does not begin with a dot may have the PC_HIDDEN attribute. If you want to know more about this attribute, see the articles listed below under Related Stories.