6.5

Table Of Contents
You can use each name that has been returned to refer to datastore paths by using square bracket
notation.
'[my_datastore] dir/subdir/file'
n
List the content of a directory in a datastore.
vifs --server <my_ESXi> --username root --password <pswd>--dir '[Storage1]'
vifs --server <my_ESXi> --username root --password <pswd> --dir '[Storage1] WindowsXP'
The command lists the directory content. In this example, the command lists the contents of a virtual
machine directory.
Content Listing
_________________
vmware-37.log
vmware-38.log
...
vmware.log
...
winxpPro-sp2.vmdk
winxpPro-sp2.vmx
winxpPro-sp2.vmxf
...
n
List the contents of one of the datastores.
vifs <conn_options> --dir '[osdc-cx700-02]'
The command lists the complete contents of the datastore.
Working with Directories and Files on the Remote Server
n
Create a new directory in a datastore with --mkdir <remote_dir>.
vifs --server <my_ESXi> --username root --password <pswd> --mkdir '[Storage1] test'
n
Remove a directory with --rmdir <remote_dir>.
vifs --server <my_ESXi> --username root --password <pswd> --rmdir '[Storage1] test'
n
Forcibly remove a directory with --rmdir --force <remote_dir>.
vifs --server <my_ESXi> --username root --password <pswd> --rmdir '[Storage1] test2' --force
n
Update a le on the remote server with --put <local_path> <remote_path>.
vifs --server <my_ESXi> --username root --password <pswd>
--put /tmp/testfile '[Storage1] test/testfile'
n
Retrieve a le from the remote server with --get <remote_path> <local_path>|<local_dir>. The
command overwrites the local le if it exists. If you do not specify a le name, the le name of the
remote le is used.
vifs --server <my_ESXi> --username root --password <pswd> --get '[Storage1]
test/testfile' /tmp/tfile
vifs --server <my_ESXi> --username root --password <pswd> --get '[Storage1]
test/testfile' /tmp
n
Delete a le on the remote server with -rm <remote_path>.
vifs --server <my_ESXi> --username root --password <pswd> --rm '[Storage1] test2/testfile'
vSphere Command-Line Interface Concepts and Examples
38 VMware, Inc.