Skip Headers

Oracle® JRockit Virtual Edition User's Guide Release 2.0.0 Part Number E22518-01 |
Home | Contents | Contact Us

Previous | Next
| View PDF

# -f (--file)

The `-f` option enables you to perform the following tasks in the file system of a virtual machine image:

- Copy files from the file system of a virtual machine image to the local file system and vice versa.

- View directory listings.

- Move and rename files.

- Create and delete directories.

- Find files.

- Display the contents of text files.

Caution:

Unless you are familiar with the file system of a virtual machine image, do not use the `-f` option for modifying the file system. For more information, see Section 2.4, "About the File System of a Virtual Machine."

Syntax

    java -jar jrockitve-imagetool.jar -f vm_cfg operation [parameter]*

Note:

For information about the syntax conventions, see Documentation Conventions for Command-Line Syntax.

When specifying directory paths in the file system of a virtual machine, use slashes (/) as path delimiters. A slash (/) at the beginning of the path represents the root directory. A period (.) at the beginning of the path represents the current directory. Two periods (..) indicate the parent directory.

For directory paths in the local file system, use the appropriate delimiter: slash (/) on UNIX-like operating systems and backslash (\) on Windows.

Arguments

Argument | Description
--- | ---
`vm_cfg` | Path and name of the configuration file corresponding to the virtual machine file system that you want to view or modify
`operation` | The file operation (see Table A-1) to be performed
`parameter` | The parameters required for the specified file operation

The parameters that you can specify vary depending on the operation. Table A-1, lists the parameters for each operation.

Table A-1 Operations and Parameters of the -f Option

Operation and Parameters | Purpose
--- | ---
    get path_in_virtual_machine path_in_local_filesystem
| Copy virtual machine files to the local file system.
    rget path_in_virtual_machine path_in_local_filesystem
| Copy virtual machine files recursively to the local file system.
    put path_in_local_filesystem path_in_virtual_machine
| Copy files from the local file system to the file system of a virtual machine image.
    rput path_in_local_filesystem path_in_virtual_machine
| Copy files recursively from the local file system to the file system of a virtual machine image.
    ls [file_pattern]*
| List files and directories.
    rls [file_pattern]*
| List files and directories recursively.
    mv from_file_pattern to_file_pattern
| Move or rename files.
    mkdir directory_name+
| Create a directory.
    rm file_pattern+
| Delete files.
    rrm file_pattern+
| Delete files recursively.
    rmdir directory_pattern+
| Delete directories.
    cat file_pattern+
| Display the contents of text files.
    find pattern
| Search for files matching the specified pattern.

Note:

When specifying local directory paths and file names that contain spaces or wildcards, enclose the parameter in double quotation marks.

For example, to copy all the `.prop` files from a local directory named "`my app`" to the root directory in the file system of the virtual machine, use double quotation marks as shown below:

    java -jar jrockitve-imagetool.jar -f vm_cfg put "my app\*.prop" ./

Examples

In all of these examples, the virtual machine configuration file (`vm.cfg`) is assumed to reside in the `app` directory.

- get

      java -jar jrockitve-imagetool.jar -f app/vm.cfg get /jrockitve/log/* /tmp

  This command copies all the files in the `/jrockitve/log` directory in the file system of a virtual machine image to the `/tmp` directory of the local file system.

- put

      java -jar jrockitve-imagetool.jar -f app/vm.cfg put new/app.class app

  This command copies a Java class file named `app.class` from the `new` directory in the local file system to the `/app` directory in the file system of the virtual machine image.

- ls

      java -jar jrockitve-imagetool.jar -f app/vm.cfg ls /jrockitve/log

  This command lists the contents of `/jrockitve/log` directory in the file system of the virtual machine image.

- mv

      java -jar jrockitve-imagetool.jar -f app/vm.cfg mv app/app.class new.class

  This command renames the `app/app.class` file in the file system of the virtual machine image to `new.class` and moves the renamed file to the root (`/`) directory.

- mkdir

      java -jar jrockitve-imagetool.jar -f app/vm.cfg mkdir app/data

  This command creates a directory named `data` in the `/app` directory in the file system of the virtual machine image.

- rm

      java -jar jrockitve-imagetool.jar -f app/vm.cfg rm app/app.class

  This command deletes the `app.class` file from the `/app` directory in the file system of the virtual machine image.

- rmdir

      java -jar jrockitve-imagetool.jar -f app/vm.cfg rmdir app/data

  This command deletes the `/app/data` directory from the file system of the virtual machine image. If the directory is not empty, the Image Tool displays an error message.

- cat

      java -jar jrockitve-imagetool.jar -f app/vm.cfg cat /jrockitve/log/jrockitve.log

  This command displays the contents of the `/jrockitve/log/jrockitve.log` file in the file system of a virtual machine image.

- find

      java -jar jrockitve-imagetool.jar -f app/vm.cfg find log

  This command searches the file system of a virtual machine image for files and directories that have `log` in the name, and displays the results on the screen.

Related Topics

Modifying the File System Within a Virtual Machine Image by Using the Image Tool