6.0

Table Of Contents
VMware, Inc. 33
Chapter 3 Managing Files
Toavoidproblemswithdirectorynamesthatusespecialcharactersorspaces,enclosethepathinquotesfor
bothoperatingsystems.
Whenyourunvifs,youcanspecifytheoperationnameandargumentandoneofthestandardconnection
options.Usealiases,symboliclinks,orwrapperscriptstosimplifytheinvocation
syntax.
Options
vifscommandspecificoptionsallowyoutoretrieveanduploadfilesfromtheremotehostandperforma
numberofotheroperations.Allvifsoptionsworkondatastorefilesordirectories.Someoptionsalsowork
onhostfilesandfilesinthetempdirectory.Youmustalsospecifyconnectionoptions.
Temp The/tmpdirectoryandfilesinthatdirectory.
Specifytemplocationsbyusingthe
/tmp/dir/subdirsyntax.
Notsupported.
Datastores
Datastorefilesanddirectories.Youhavetwochoicesforspecifyingadatastore:
Datastore prefixstyle:'[ds_name] relative_path'.Forexample:
'[myStorage1] testvms/VM1/VM1.vmx'(Linux) or "[myStorage1]
testvms/VM1/VM1.vmx" (Windows)
URLstyle:/folder/dir/subdir/file?dsName=<name>.Forexample:
'/folder/testvms/VM1/VM1.vmx?dsName=myStorage1' (Linux)
"/folder/testvms/VM1/VM1.vmx?dsName=myStorage1" (Windows)
Thetwoexamplepathsrefertoavirtualmachineconfigurationfileforthevirtualmachine
VM1inthetestvms/VM1directoryofthemyStorage1datastore.
IMPORTANTTheconceptsofworkingdirectoryandlastdirectoryorfileoperatedonarenotsupportedwith
vifs.
Command Description Target Syntax
--copy
-c <source>
<target>
Copiesafileinadatastoretoanotherlocation
inadatastore.The<source>mustbearemote
sourcepath,the<target>aremotetarget
pathordirectory.
The--forceoptionreplacesexisting
destinationfiles.
Datastore
Temp
copy src_file_path
dst_directory_path
[‐‐force]
copy src_file_path
dst_file_path [‐‐force]
--dir
-D <remote_dir>
Liststhecontentsofadatastore
directory. Datastore
Temp
dir
datastore_directory_path
--force
-F
Overwritesthedestinationfile.Usedwith
--moveand--copy.
Datastore
Temp
copy src_file_path
dst_file_path [‐‐force]
--get
-g <remote_path>
<local_path>
DownloadsafilefromtheESXihosttothe
machineonwhichyourunvCLI.This
operationusesHTTP GET.
Datastore
Host
get src_dstore_file_path
dst_local_file_path
get src_d store_dir_path
dst_local_file_path
--listdc
-C
Liststhedatacenterpathsavailableon
an
ESXisystem.
Datastore
Host
--listds
-S
ListsthedatastorenamesontheESXisystem.
Whenmultipledatacentersareavailable,use
the--dc (-Z)argumenttospecifythename
ofthedatacenterfromwhichyouwanttolist
thedatastore.
Datastore
Host
vifs --listds
--mkdir
-M <remote_dir>
Createsadirectoryinadatastore.This
operation
failsiftheparentdirectoryof
dst_datastore_file_pathdoesnotexist.
Datastore
Temp
mkdir dst_directory_path
vSphere 4.x vSphere 5.0