AFS Command Reference - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software

In the table of AFS commands, an ellipses (...) indicates that the prior construct may be specified multiple times. For example < src > ... indicates that you may specify as many sources as you like.

AFS Commands in ACT
Parameter Description
\afs -cat <src> Fetches all files that match the file pattern <src> and displays their content on stdout.
\afs -chgrp [-R] <group> <path> ... Changes the group that owns a directory or file (recursively if -R is specified).
\afs -chmod [-R] <mode>[,<mode>] ... 
| <octalmode> 
<path> ... Changes the permissions on a file or directory (recursively if -R is specified).

<mode> is same as the modes used for the chmod shell command. It takes the form < role > +|-|= < permission >.

Available < role > options are:

  • u for user/owner
  • o for others
  • a for all

If no role is specified, a is assumed, and unlike the shell command, no umask is applied.

Available < permission > options are:

  • r for read
  • w for write
  • x for execute

Use <octalmode> to specify the mode using three digits. These follow the same rules as the shell command, but unlike the shell command, this usage requires all three digits.

For example. specifying 754 is the same as u=rwx,g=rx,o=r

Only octal mode is supported for the Windows 32-bit and Solaris SPARC platforms.
\afs -chown [-R] [<owner>]
[:[<group>]] 
<path> ... Changes the owner (and optionally the group) of a file or directory (recursively if -R is specified). If only the owner or group is specified, then it alone will be modified.

Owner and group names are case sensitive and may only consist of alphanumeric characters, and any of-_.@/.

Avoid using '.' to separate owner name and group. If owner names have dots in them and you are using a local file system, you might see unexpected results since the shell command 'chown' is also used for local files.

\afs -copyFromLocal <localsrc> ... <dst> Identical to the -put command. Copies file(s) from the local file system into AFS.
\afs -copyToLocal 
[-ignoreCrc] [-crc] <src> <localdst> Identical to the -get command. Copies all the files that match the source file pattern to the local destination specified. Use the -crc option to perform a checksum (cyclic redundancy check) on the file before copying or the -ignoreCrc option to not perform the check. The local destination must be a directory. The source file(s) are retained.
\afs -count[-q] <path> Counts the number of directories, files and bytes under the paths that match the specified file pattern.

The output columns are:

  • DIR_COUNT
  • FILE_COUNT
  • CONTENT_SIZE
  • FILE_NAME

When including the -q option, the output columns are:

  • QUOTA
  • REMAINING_QUOTA
  • SPACE_QUOTA
  • REMAINING_SPACE_QUOTA
  • DIR_COUNT
  • FILE_COUNT
  • CONTENT_SIZE
  • FILE_NAME

For quota values, the maximum space available will be show, because AFS does not support quotas per user.

\afs -cp <src> <dst> Copies all files that match the file pattern < src > to a destination. When copying multiple files, the destination must be a directory. Also, when copying multiple files, the last file is copied to the destination directory. For example:

\afs -cp source1/file_1 /source2/file_1 /test/

/source2/file_1 is copied to the destination directory /test/.

\afs -du <path> Shows the amount of space, in bytes, used by the file specified. If a directory is specified, shows the sizes of files and directories it contains.

Equivalent to the UNIX commands:

  • du -sb < path >/* in case of a directory
  • du -b < path > in case of a file

The output is in the form name (full path) size (in bytes).

\afs -dus <path> Shows a summary of the amount of space, in bytes, used by the files that match the specified pattern. Equivalent to the UNIX command du -sb. The output is in the form name (full path) size (in bytes).
\afs -expunge Cleans up the trash.
\afs -get 
[-ignoreCrc] [-crc] <src> <localdst> Copies all the files that match the source file pattern to the local destination specified. Use the -crc option to perform a checksum (cyclic redundancy check) on the file before copying or the 
-ignoreCrc option to not perform the check. The local destination must be a directory. The source file(s) are retained.
\afs -getmerge <src> <localdst> [addnl] Gets all the files that match the source file pattern and merges and sorts them into a single file on the local file system. Specify the addnl flag to insert a line break between the contents of each file in the output file. The source files remain as they are.
\afs -help [<afs_cmd>] Displays help for the given command or all commands if none is specified.
\afs -ls <path> Lists information about files that match the specified pattern. If a path is not specified, the contents of /user/< currentUser > will be listed. Directory entries are of the form dirName (full path) < dir > and file entries are of the form fileName(full path) < r n > size where n is the number of replicas specified for the file and size is the size of the file, in bytes.
\afs -lsr <path> Recursively lists the information about files that match the specified pattern. Behaves very similarly to Hadoop fs -ls, except that the data is shown for all the entries in the subtree.
\afs -mkdir <path> Creates a directory in the specified location(s). Similar to UNIX mkdir -p in that it will create parent directories along the path.
\afs -moveFromLocal <localsrc> ... <dst> Same as -put, except that the local source file(s) are deleted after they are copied.
\afs -mv <src> <dst> Moves files that match the specified file pattern < src > to a destination. When moving multiple files, the destination must be a directory. Also, when moving multiple files, the last file is moved to the destination directory. For example:

\afs -mv source1/file_1 /source2/file_1 /test/

/source2/file_1 is moved to the destination directory /test/.

\afs -put <localsrc> ... <dst> Copies file(s) from the local file system into AFS.
\afs -rm 
[-skipTrash] <path> Deletes all files that match the specified pattern. Equivalent to the UNIX command rm < src >. Use the -skipTrash option to bypass the trash and immediately delete < src >.
\afs -rmr 
[-skipTrash] <path> Recursively deletes all directories that match the specified pattern. Equivalent to the UNIX command rm -rf < src >. Use the 
-skipTrash option to bypass the trash and immediately delete < path >.
\afs -set [property[=value]] Sets the specified Java property to the specified value on the client. If only the property is specified, shows its value. If no property is specified, displays all properties and their values.

Valid properties are listed in Java Properties for AFS Clients.

\afs -setLogLevel category[=logLevel] Defines the minimum set of levels recognized by the system. The levels are OFF, FATAL, EROR, WARN, INFO, DEBUG, TRACE, or ALL. The default level is ERROR.
\afs -setrep [-R] 
[-w] <rep> <path> Sets the replication level of a directory or file (recursively if -R is specified).
\afs -stat [<format>] <path> Prints statistics about the file or directory at < path > in the specified format. Format accepts filesize in blocks (%b), filename (%n), lock size (%o), replication (%r), modification date (%y, %Y).
\afs -tail [-f] <file> Shows the last 1KB of the file. The -f option shows appended data as the file grows.
\afs -test -[ezd] <path> Tests the properties of a file or directory and returns 0 if the test fails or 1 if it succeeds. Specify properties as one or more arguments:

-e tests if the file exists.

-z tests if the file has zero length.

-d tests if the file is a directory.

If no options are specified, tests for all (i.e. if the file exists, has zero length, and is a directory then returns 0, else returns 1).

\afs -text <src> Takes a source file and outputs the file in text format. The allowed input formats are .zip and TextRecordInputStream.
\afs -touchz <path> Creates a file of zero length with a timestamp in the format yyyy-MM-dd HH:mm:ss at < path >. If the file already exists with a non-zero length, an error is returned.