6.2.8.6 ls
List files and vaults.
Purpose
The ls
command displays information about Exascale files and vaults.
Syntax
ls [ name [ name ]... ] [ -l ] [ --detail ]
[ --attributes attribute[,attribute]... ]
[ --filter filter[,filter]... ]
[ --sort [-]attribute[,[-]attribute]... ]
[ --count value ] [ -t ] [ --include-being-deleted ]
Command Options
The options for the ls
command are:
-
name: 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
: Displays output in a long, tabular format. -
--detail
: Displays detailed output with additional attributes. -
--attributes
: Identifies specific attributes to display in the output.You can use this option to focus on a subset of attributes as an alternative to the
--detail
option. -
--filter
: Specifies conditions for including items in the output. -
--sort
: Sorts the output using the specified attributes. -
--count
: Specifies the maximum number of items to display in the output. -
-t
: Sorts files or vaults by ascending creation time. -
--include-being-deleted
: Lists all files, including deleted files in the process of releasing their allocated storage.
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 1 PM today and with a size greater than 10 megabytes:
--filter createTime>13: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-87 Display All Vaults
If you use the ls
command at the root level,
you get a listing of all
vaults.
@> ls
my-data
vault2
Example 6-88 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 @my-data/
x
y
z1
z2
z3
Example 6-89 Display File Information in a Long Format
If you use the -l
option, the output includes
additional information about each file or
vault.
@my-data/> 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-90 Sorting the Output of the ls Command
The following example shows the files in the vault
my-data
, with the most recent appearing
first.
@my-data/> ls --sort -createTime
z2
z3
z1
y
x
Example 6-91 Listing Files Using a Wildcard Search
You can use the *
symbol as a wildcard when
specifying the files to
list.
@my-data> ls z*
z1
z2
z3
Example 6-92 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
my-data
.
@> ls @my-data/x --detail
name x
size 0
createTime 2019-01-05 12:59:57 GMT
fileType 8
vault.name my-data
vault.createTime 2018-11-08 22:41:07 GMT
Example 6-93 Display Specific Attributes for Files or Vaults
The following example shows the size, name, and vault name
attributes for the files in the my-data
vault.
@my-data/> ls -l --attributes size,name,vault.name
Total 5
0 x my-data
19.5k y my-data
5.0k z1 my-data
10.0M z2 my-data
20.0G z3 my-data
Parent topic: File Management