Test (Unix) - Functions

Functions

The following functions are used to construct this parameter:

-e FileName - FileName exists.

Note: All remaining functions return true if the object (file or string) exists, and the condition specified is true.

-b Filename - Returns a True exit value if the specified FileName exists and is a block special file. -c FileName - FileName is a character special file. -d FileName - FileName is a directory. -f FileName - FileName is a regular file. -g FileName - FileName's Set Group ID bit is set. -h FileName - FileName is a symbolic link. -k FileName - FileName's sticky bit is set. -L FileName - FileName is a symbolic link. -p FileName - FileName is a named pipe (FIFO). -r FileName - FileName is readable by the current process. -s FileName - FileName has a size greater than 0. -t FileDescriptor - FileDescriptor is open and associated with a terminal. -u FileName - FileName's Set User ID bit is set. -w FileName - FileName's write flag is on. However, the FileName will not be writable on a read-only file system even if test indicates true. -x FileName - FileName's execute flag is on. If the specified file exists and is a directory, the True exit value indicates that the current process has permission to change (chdir) into the directory. file1 -nt file2 - file1 is newer than file2. file1 -ot file2 - file1 is older than file2. file1 -ef file2 - file1 is another name for file2. (symbolic link or hard link)

Read more about this topic:  Test (Unix)

Famous quotes containing the word functions:

    Let us stop being afraid. Of our own thoughts, our own minds. Of madness, our own or others’. Stop being afraid of the mind itself, its astonishing functions and fandangos, its complications and simplifications, the wonderful operation of its machinery—more wonderful because it is not machinery at all or predictable.
    Kate Millett (b. 1934)

    When Western people train the mind, the focus is generally on the left hemisphere of the cortex, which is the portion of the brain that is concerned with words and numbers. We enhance the logical, bounded, linear functions of the mind. In the East, exercises of this sort are for the purpose of getting in tune with the unconscious—to get rid of boundaries, not to create them.
    Edward T. Hall (b. 1914)

    Those things which now most engage the attention of men, as politics and the daily routine, are, it is true, vital functions of human society, but should be unconsciously performed, like the corresponding functions of the physical body.
    Henry David Thoreau (1817–1862)