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:

    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)

    The English masses are lovable: they are kind, decent, tolerant, practical and not stupid. The tragedy is that there are too many of them, and that they are aimless, having outgrown the servile functions for which they were encouraged to multiply. One day these huge crowds will have to seize power because there will be nothing else for them to do, and yet they neither demand power nor are ready to make use of it; they will learn only to be bored in a new way.
    Cyril Connolly (1903–1974)