3.3. File Command Reference

3.3.1. Command Hierarchy

3.3.1.1. Configuration Commands

attrib [+r | -r] file-url
attrib
cd [file-url]
copy source-file-url dest-file-url [force]
delete file-url [force]
dir [file-url] [sort-order {d | n | s}] [reverse]
format cflash cflash-id [reliable]
md file-url
move old-file-url new-file-url [force]
rd file-url rf [force]
repair [cflash-id]
scp local-file-url destination-file-url [router router-instance] [force]
[no] shutdown cflash-id
type file-url
version file-url [check]

3.3.2. Configuration Commands

3.3.2.1. File Commands

shutdown

Syntax 
[no] shutdown [cflash-id]
Context 
file
Supported Platforms 

7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C

Description 

This command disables the drive. This command is available for use only with removable storage drives. The removable storage drives differ among the 7210 SAS platforms. It cannot be used with the internal non-removable compact flash.

The no form of this command enables the drive.

Default 

no shutdown

Parameters 
cflash-id—
Specifies the device identifier.
Values—
cf1:, uf1:

 

attrib

Syntax 
attrib [+r | -r] file-url
attrib
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command sets or clears the read-only attribute for a file in the local file system. To list all files and their current attributes enter attrib or attrib x where x is either the filename or a wild-card (*).

When an attrib command is entered to list a specific file or all files in a directory, the file’s attributes are displayed with or without an “R” preceding the filename. The “R” implies that the +r is set and that the file is read-only. Files without the “R” designation implies that the -r is set and that the file is read-write-all.

Parameters 
file-url—
Specifies the URL for the local file.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

+r—
Keyword to set the read-only attribute on the specified file.
-r—
Keyword to clears/reset the read-only attribute on the specified file.

cd

Syntax 
cd [file-url]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command displays or changes the current working directory in the local file system.

Parameters 
file-url—
Specifies the URL for the local file.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

none—
Displays the current working directory.
..—
Specifies the parent directory. This can be used in place of an actual directory name in a directory-url.
directory-url—
Specifies the destination directory.

copy

Syntax 
copy source-file-url dest-file-url [force]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command copies a file or all files in a directory from a source URL to a destination URL. At least one of the specified URLs should be a local URL. The optional wild-card (*) can be used to copy multiple files that share a common (partial) prefix and/or (partial) suffix. When a file is copied to a destination with the same file name, the original file is overwritten by the new file specified in the operation. The following prompt appears if the destination file already exists:

“Overwrite destination file (y/n)?”

For example:

To copy a file named srcfile in a directory called test on cf1 to a file called destfile in a directory called production on cf1, the syntax is:

sr1>file cf1:\ # copy cf2-/test/srcfile/production/destfile

To FTP a file named 121201.cfg in directory mydir stored on cf1 to a network FTP server with IP address 192.0.2.79 in a directory called backup with a destination file name of 121201.cfg, the FTP syntax is:

copy /mydir/121201.cfg 192.0.2.79/backup/121201.cfg

Parameters 
source-file-url—
Specifies the location of the source file or directory to be copied.
dest-file-url—
Specifies the destination of the copied file or directory.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

force—
Keyword to force an immediate copy of the specified files. The

file copy force command is executed without displaying a user prompt message

delete

Syntax 
delete file-url [force]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command deletes the specified file.

The optional wild-card “*” can be used to delete multiple files that share a common (partial) prefix and/or (partial) suffix. When the wild-card is entered, the following prompt displays for each file that matches the wild-card:

“Delete file <filename> (y/n)?”

Parameters 
file-url—
Specifies the file name to delete.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

force—
Keyword to force an immediate deletion of the specified files. The file delete * force command is executed without displaying a user prompt message

dir

Syntax 
dir [file-url] [sort-order {d | n | s}] [reverse]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command displays a list of files and subdirectories in a directory.

Parameters 
file-url—
Specifies the path or directory name; use the file-url with the optional wildcard (*) to reduce the number of files to list.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

sort-order {d | n | s}
Specifies the sort order.
Values—
d — date
n — name
s — size

 

reverse —
Specifies to reverse the sort order.

file

Syntax 
file
Context 
root
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command enables the context to enter and perform file system operations. When entering the file context, the prompt changes to reflect the present working directory. Navigating the file system with the cd command results in a changed prompt.

The exit all command leaves the file system/file operation context and returns to the <root> CLI context. The state of the present working directory is maintained for the CLI session. Entering the file command returns the cursor to the working directory where the exit command was issued.

format

Syntax 
format cflash cflash-id
Context 
root>file
Supported Platforms 

7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C

Description 

This command formats the compact flash. The compact flash must be shut down before starting the format.

Parameters 
cflash-id—
Specifies the compact flash type.
Values—
cf1:, uf1:

 

md

Syntax 
md file-url
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command creates a new directory in a file system.

Directories can only be created one level at a time.

Parameters 
file-url—
Specifies the directory name to be created.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

move

Syntax 
move old-file-url new-file-url [force]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command moves a local file, system file, or a directory. If the target already exists, the command fails and an error message displays.

The following prompt appears if the destination file already exists:

“Overwrite destination file (y/n)?”

Parameters 
old-file-url—
Specifies the file or directory to be moved.
new-file-url—
Specifies the new destination to place the old-file-url.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

force—
Keyword to force an immediate move of the specified files. The

file move force command is executed without displaying a user prompt message.

rd

Syntax 
rd file-url rf [force]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command is used to delete a directory.

If a directory has files and no sub-directories, the force option must be used to force delete the directory and files it contains.

Parameters 
file-url—
Specifies the directory to be removed.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

rf—
Specifies that the parameter forces a recursive delete.
force—
Keyword to force an immediate deletion of the specified directory.

The rd file-url force command is executed without displaying a user prompt message.

repair

Syntax 
repair [cflash-id]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command checks a compact flash device for errors and repairs any errors found.

Parameters 
cflash-id —
Specifies the compact flash slot ID.
Values—
cf1: (7210 SAS-D, 7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

Default—
the current compact flash device

scp

Syntax 
scp local-file-url destination-file-url [router router-instance] [force]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command copies a local file to a remote host file system. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. The following prompt appears:

“Are you sure (y/n)?” The destination must specify a user and a host.

Parameters 
local-file-url—
Specifies the local source file or directory.

local-file-url — [cflash-id/] [file-path]

cflash-id or usb-flash-id

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

destination-file-url—
Specifies the destination file.
user—
Specifies the SSH user.
host—
Specifies the remote host IP address of DNS name.
file-path—
Specifies the destination path.
router-instance
Specifies the router name or service ID.
Values—
router-instanceuser@hostname:file-path] | router-name
user — up to 32 characters
hostname — [dns-name | ipv4-address | ipv6-address]
                     ipv4-address — a.b.c.d
                     ipv6-address — x:x:x:x:x:x:x:x[-interface]
                                               x:x:x:x:x:x:d.d.d.d[-interface]
                                               x — 0 to FFFF (hexadecimal)
                                               d — 0 to 255 (decimal)
                                               interface — up to 32 characters max,                                                for link local addresses
dns-name — up to 128 characters
file-path — up to 200 characters
                 directory length, up to 99 characters each
router-name — Base, Management
                           Default - Base

 

force—
Keyword to force an immediate copy of the specified file. The

file scp local-file-url destination-file-url [router] force command is executed without displaying a user prompt message.

type

Syntax 
type file-url
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command displays the contents of a text file.

Parameters 
file-url—
Specifies the file name of the target file.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

version

Syntax 
version file-url [check]
Context 
file
Supported Platforms 

Supported on all 7210 SAS platforms as described in this document

Description 

This command displays the version of a -TiMOS file.

Parameters 
file-url—
Specifies the file name of the target file.
Values—

file-url local-url | remote-url

local-url — [cflash-id/ | usb-flash-id] [file-path]

remote-url — [{ftp:// | tftp://} login:pswd@remote-locn/] [file- path]

remote-locn — [hostname | ipv4-address | ipv6-address]                          ipv4-address — a.b.c.d                          ipv6-address — x:x:x:x:x:x:x:x[-interface]                          x:x:x:x:x:x:d.d.d.d[-interface]                          x — 0 to FFFF (hexadecimal)                          d — 0 to 255 (decimal)                          interface — a string up to 32, for link local addresses

cflash-id or usb-flash-id —

cf1: (7210 SAS-D, 7210 SAS-Dxp)

cf1:, uf1: (7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, 7210 SAS-K 3SFP+ 8C)

 

check—
Keyword to validate the .tim file.