6.2.8.6 ls

List files and vaults.

Purpose

The ls command displays information about Exascale files and vaults.

Syntax

ls [ filename [ filename ] ... ] [ -l ] [ --detail ] [ --attributes attribute[,attribute] ... ] 
     [ --filter filter[,filter] ... ] [ --sort [-]attribute[,[-]attribute] ... ] 
     [ --count value ] [ -t ]

Command Options

The options for the ls command are:

  • filename: A file or vault name that you want to display information for. Vault names are preceded with the @ symbol. The asterisk (*) can be used for wildcard searches. If not specified, then information is displayed about all files or vaults in the current level of the ESCLI file hierarchy.

  • -l: Returns output in a long, tabular form.

  • --detail: Lists all attributes in a detailed form.

  • --attributes: Lists the specific attributes to display.

  • --filter: Used to specify conditions for filtering the list output.

  • --sort: Used to sort the output using the specified attributes.

  • --count: Specifies the maximum number of results to report.

  • -t: Sorts files or vaults by ascending creation time.

Usage Notes

Note the following information when using this command:

  • Filter conditions are specified as: <attribute><operator><value>.

    Attributes can be file attributes, or vault attributes with the vault. prefix.

    The allowed operators are =, !=, >=, <=, >, and <.

    Multiple comma-separated filter conditions are combined using AND logic.

    Dates can be specified using the following formats:

    • yyyy-MM-dd''T''HH:mm:ss
    • yyyy-MM-dd (Time is assumed to be 00:00 AM)
    • HH:mm:ss (Date is assumed to be today)

    A date can also be followed by a timezone specification.

    File sizes can be specified using suffixes K, KB, M, MB, G, GB, T, TB. The suffix is not case-sensitive.

    For example, the following filter only includes files created after noon today and with a size greater than 10 megabytes:

    --filter creationTime>12:00:00,size>10M
  • Sorting attributes are specified as: [-]attribute. Multiple sort attributes are comma-delimited. The default sort order is ascending. For descending sort order, prefix the attribute name with -.

    For example, use the following to primarily sort by name in descending order, and use creation time in ascending order to further sort entries with the same name:

    --sort -name,createTime

Examples

Example 6-88 Display All Vaults

If you use the ls command at the root level, you get a listing of all vaults.

@> ls
MYDATA
VAULT2

Example 6-89 Display Files in a Vault

You can specify the name of a vault followed by the slash character (/) to list all the files within the vault.

@> ls @MYDATA/
x 
y 
z1 
z2 
z3 

Example 6-90 Display File Information in a Long Format

If you use the -l option, the output includes additional information about each file or vault.

@MYDATA/> ls -l
Total 5
  10.0M   05 Jan 12:59 x 
  19.5k   05 Jan 13:08 y 
   5.0k   05 Jan 13:09 z1 
  10.0M   05 Jan 13:23 z2 
  20.0G   05 Jan 13:14 z3 

Example 6-91 Sorting the Output of the ls Command

The following example shows the files in the vault MYDATA, with the most recent appearing first.

@MYDATA/> ls --sort -createTime
z2 
z3 
z1 
y 
x 

Example 6-92 Listing Files Using a Wildcard Search

You can use the * symbol as a wildcard when specifying the files to list.

@MYDATA> ls z*
z1 
z2 
z3 

Example 6-93 Display Detailed File Information

If you use the --detail option, the output includes detailed information about the files and vaults. This example shows the detailed output for the file x in the vault MYDATA.

@> ls @MYDATA/x --detail
name                    x
size                    0
createTime              2019-01-05 12:59:57 GMT
fileType                8
vault.name              MYDATA
vault.createTime        2018-11-08 22:41:07 GMT

Example 6-94 Display Specific Attributes for Files or Vaults

The following example shows the size, name, and vault name attributes for the files in the MYDATA vault.

@MYDATA/> ls -l --attributes size,name,vault.name
Total 5
      0 x MYDATA 
  19.5k y MYDATA 
   5.0k z1 MYDATA 
  10.0M z2 MYDATA 
  20.0G z3 MYDATA