2. File System Management

2.1. The File System

The SR OS file system is used to store files used and generated by the system, for example, image files, configuration files, logging files and accounting files.

The file commands allow you to copy, create, move, and delete files and directories, navigate to a different directory, display file or directory contents and the image version.

Although some of the storage devices on routers are not actually compact flash devices (for example, cf1: on the 7950 XRS is an internal SSD), we refer to all storage devices as compact flash.

2.1.1. Storage Devices

The file system is based on a DOS file system. In the 7750 SR and 7450 ESS, each control processor can have up to three storage devices numbered one through three. In the 7950 XRS, each CCM has an SSD and up to two compact flash devices. The names for these devices are:

  1. cf1:
  2. cf2:
  3. cf3:

The above device names are relative device names as they refer to the devices local to the control processor with the current console session. As in the DOS file system, the colon (“:”) at the end of the name indicates it is a device.

The three compact flash devices on the 7450 ESS and 7750 SR OS are removable and have an administrative state.

The cf2: and cf3: compact flash devices on the 7950 XRS routers are removable and have an administrative state. cf1: is an internal SSD.

Devices vary by platform as compact flash, SD card, USB, or embedded SSD. The format used for the removable storage devices is DOS FAT32. The maximum size supported is 32 GB.

Note:

To prevent corrupting open files in the file system, you should only remove a compact flash that is administratively shutdown. SR OS gracefully closes any open files on the device, so it can be safely removed.

2.1.2. URLs

The arguments for the SR OS file commands are modeled after standard universal resource locater (URL). A URL refers to a file (a file-url) or a directory (a directory-url).

The SR OS supports operations on both the local file system and on remote files. For the purposes of categorizing the applicability of commands to local and remote file operations, URLs are divided into five types of URLs: local, ftp, tftp, http, and https. The syntax for each of the URL types are listed in Table 3.

Table 3:  URL Types and Syntax  

URL Type

Syntax

Notes

local-url

[cflash-id:\]path

cflash-id is the compact flash device name.

Values: cf1:, cf2:, cf3:

ftp-url

ftp://[username[:password]@]host/path

An absolute ftp path from the root of the remote file system.

username is the ftp user name

password is the ftp user password

host is the remote host

path is the path to the directory or file

ftp://[username[:password]@]host/./path

A relative ftp path from the user’s home directory. Note the period and slash (“./”) in this syntax compared to the absolute path.

tftp-url

tftp://host[/path]/filename

tftp is only supported for operations on file-urls.

http-url

http://[username[:password]@]host[:port]/path

host is an HTTP server

port defaults to 80

https-url

https://[username[:password]@]host[:port]/path

host is an HTTPS server

port defaults to 443

If the host portion of the URL is an IPv6 address, then the address should be enclosed in square brackets. For example:

ftp://user:passw@[3ffe::97]/./testfile.txt

tftp://[2001:db8:3333:4444:5555:6666:7777:8888]/./testfile.txt

The system accepts either forward slash (/) or backslash (\) characters to delimit directory and/or filenames in URLs. Similarly, the SR OS SCP client application can use either slash or backslash characters, but not all SCP clients treat backslash characters as equivalent to slash characters. In particular, UNIX systems will often times interpret the backslash character as an escape character. This can cause problems when using an external SCP client application to send files to the SCP server. If the external system treats the backslash like an escape character, the backslash delimiter will get stripped by the parser and will not be transmitted to the SCP server.

For example, a destination directory specified as “cf1:\dir1\file1” will be transmitted to the SCP server as “cf1:dir1file1” where the backslash escape characters are stripped by the SCP client system before transmission. On systems where the client treats the backslash like an escape character, a double backslash (\\) or the forward slash (/) can typically be used to properly delimit directories and the filename.

When a special character is used in a password, it can cause issues when that password is encoded as part of a URL. To prevent this issue, percent encoding can be used. Percent encoding is a mechanism to encode 8-bit characters that have specific meaning in the context of URLs. The encoding consists of substitution of a percent character (%) followed by the hexadecimal representation of the ASCII value of the replaced character.

Some file manipulation commands such as copying, removing, or moving files, may request access to an HTTP or HTTPS server. If an HTTP or HTTPS server redirects the system to a different URL (from an "HTTP 301" error or similar response), the system prompts the user "y/n" to either repeat the operation with the new URL or terminate it. These file commands can be configured to force the HTTP redirects without prompting or they can be configured to refuse HTTP redirects. If a file command is redirected more than eight times, or if it queries an HTTPS URL and gets redirected to an HTTP URL, the command automatically terminates as a security measure.

For example, to refuse HTTP redirects, use the no-redirect parameter in the classic CLI command.

Example:
A:n-2>file cf3:\ # copy source-url dest-url no-redirect

To refuse HTTP redirects with the MD-CLI command, use the direct-http parameter.

Example:
[file "cf3:\"]
A:admin@node-2# copy source-url destination-url direct-http

To force the HTTP redirects without prompting, use the force parameter in either the classic CLI or the MD-CLI.

CLI Syntax:
(Classic): # copy source-url dest-url force
CLI Syntax:
(MD-CLI): # copy source-url destination-url force

When connecting to an HTTPS server, the system verifies the server's TLS certificate. For the certificate to pass verification, the system must have a CA profile already configured for the server's Certificate Authority (CA), which specifies up-to-date certificate and CRL files. HTTPS file commands do not use the Online Certificate Status Protocol (OCSP). If the certificate was issued by an intermediate CA, the system must have a CA profile for every CA tracing back to the root CA. If the server's certificate fails verification for any reason, the file command terminates. Refer to the 7450 ESS, 7750 SR, and VSR Multiservice Integrated Service Adapter and Extended Services Appliance Guide for more information about CA profiles.

The CLI command to configure the CA profile is in the configure system security pki ca-profile context.

An HTTPS file command may also include a client-tls-profile parameter, referring to a client TLS profile that provides the cipher list, client certificate, and trust anchor the system uses when communicating with the HTTPS server. Refer to the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide for more information about client TLS profiles.

A file command that connects to an HTTP or HTTPS server outside the local network may need to use an HTTP proxy. The user may add the proxy parameter to point to a proxy server (which must be an HTTP URL).

2.1.3. Wildcards and Special Characters

SR OS supports the standard DOS wildcard characters. The asterisk (*) can represent zero or more characters in a string of characters. The question mark (?) represents any one character and must be enclosed in quotation marks (" ").

Classic CLI example:

A:node-2>file cf3:\ # copy bof.* testdir
Copying file cf3:\bof.cfg-1 ... OK
Copying file cf3:\bof.cfg-2 ... OK
Copying file cf3:\bof.cfg-3 ... OK
Copying file cf3:\bof.cfg-4 ... OK
Copying file cf3:\bof.cfg-5 ... OK
Copying file cf3:\bof.cfg-6 ... OK
Copying file cf3:\bof.cfg-7 ... OK
Copying file cf3:\bof.cfg-8 ... OK
Copying file cf3:\bof.cfg-9 ... OK
Copying file cf3:\bof.cfg.1 ... OK
Copying file cf3:\bof.cfg ... OK
11 file(s) copied.
A:node-2>file cf3:\ #

MD-CLI Example:

[/file "cf3:\"]
A:admin@node-2# copy bof.* testdir
11 file(s) copied.
 
[/file "cf3:\"]
A:admin@node-2# 

2.2. File Management Tasks in the Classic CLI

The following sections are basic system tasks that can be performed in the classic CLI.

For more information about the supported classic CLI commands, refer to the 7450 ESS, 7750 SR, 7950 XRS, and VSR Classic CLI Command Reference Guide.

When a file system operation is performed that can potentially remove or overwrite a file system entry, a prompt appears to confirm the action. The force keyword performs the operation without displaying the confirmation prompt.

All the commands can operate on the local file system. Table 4 indicates which commands also support remote file operations.

Table 4:  File Command Local and Remote File System Support 

Command

local-url

ftp-url

tftp-url

http-url

https-url

attrib

cd

copy

delete

dir

md

move

rd

scp

source only

type

unzip

source only

source only

version

vi

2.2.1. Displaying Directory and File Information

Use the dir command to display a list of files on a file system. The type command displays the contents of a file. The version command displays the version of an SR OS image file.

Use the following CLI syntax to display directory and file information:

CLI Syntax:
file>
dir [file-url]
type file-url
version file-url

The following shows an example of the command syntax:

A:ALA-1>file cf1:\ # dir
 Volume in drive cf1 on slot A has no label.
Directory of cf1:\
01/01/1980  12:00a                7597 test.cfg
01/01/1980  12:00a                 957 b.
08/19/2001  02:14p              230110 BOOTROM.SYS
01/01/1980  12:00a                 133 NVRAM.DAT
04/03/2003  05:32a                1709 103.ndx
01/28/2003  05:06a                1341 103.cftg.ndx
01/28/2003  05:06a               20754 103.cftg
04/05/2003  02:20a      <DIR>          test
              15 File(s)                 338240 bytes.
               3 Dir(s)                 1097728 bytes free.
A:ALA-1>file cf1:\ # type fred.cfg
# Saved to /cflash1/fred.cfg
# Generated THU FEB 21 01:30:09 2002 UTC
exit all
config
#------------------------------------------
# Chassis Commands
#------------------------------------------
card 2 card-type faste-tx-32
exit
#------------------------------------------
# Interface Commands
#------------------------------------------
# Physical port configuration
interface faste 2/1
    shutdown
    mode network
exit
interface faste 2/2
    shutdown
exit
interface faste 2/3
    shutdown
exit
interface faste 2/4
A:ALA-1>file cf1:\ # version boot.tim
TiMOS-L-1.0.B3-8
A:ALA-1>file cf1:\ #

2.2.2. Modifying File Attributes

The system administrator can change the read-only attribute in the local file.

Enter the attrib command with no options to display the contents of the directory and the file attributes.

Use the following CLI syntax to modify file attributes:

CLI Syntax:
# file>
# attrib [+r | -r] file-url
Example:
# file
file cf3:\ # attrib
file cf3:\ # attrib +r BOF.SAV
file cf3:\ # attrib

The following example shows the file configuration:

     A:ALA-1>file cf3:\ # attrib
     cf3:\bootlog.txt
     cf3:\bof.cfg
     cf3:\boot.ldr
     cf3:\bootlog_prev.txt
     cf3:\BOF.SAV
A:ALA-1>file cf3:\ # attrib +r BOF.SAV
A:ALA-1>file cf3:\ # attrib
     cf3:\bootlog.txt 
     cf3:\bof.cfg
     cf3:\boot.ldr
     cf3:\bootlog_prev.txt
R    cf3:\BOF.SAV

2.2.3. Creating Directories

New directories can be created in the local file system, one level at a time.

Use the md command to create a new directory.

The cd command navigates to different directories.

CLI Syntax:
file>
md file-url

The following example shows the creation of three levels of directories.

A:node-2>file cf3:\ # md test1
A:node-2>file cf3:\ # cd test1
A:node-2>file cf3:\test1\ # md test2
A:node-2>file cf3:\test1\ # cd test2
A:node-2>file cf3:\test1\test2\ # md test3
A:node-2>file cf3:\test1\test2\ # cd test3
A:node-2>file cf3:\test1\test2\test3\ #

2.2.4. Copying Files

A variety of files and file types, including image files and configuration files, can be uploaded or downloaded to and from flash cards or TFTP servers.

Use the copy command to copy files locally.

The scp command copies files between hosts on a network. It uses SSH for data transfer, and uses the same authentication and provides the same security as SSH.

The source file for the scp command must be local. The file must reside on the router. The destination file has to be of the format: user@host:file-name. The destination does not need to be local.

CLI Syntax:
# file>
# copy <source-file-url> <dest-file-url> [force][no-redirect][client-tls-profile <tls-profile-name>][proxy <proxy-url>]
# scp <local-file-url> <destination-file-url> [router <router-instance>][force]
# scp <local-file-url> <destination-file-url> [force] service <service-name>

The following displays examples of the command syntax:

A:node-2>file cf3:\ # copy 104.cfg cf1:\test1\test2\test3\test.cfg
 
A:node-2>file cf3:\ # scp file1 admin@192.168.0.1:cf1:\file1
 
A:node-2>file cf3:\ # scp file2 user2@192.168.0.1:/user2/file2
 
A:node-2>file cf3:\ # scp cf2:/file3 admin@192.168.0.1:cf1:\file3

2.2.5. Moving Files

Files or directories can be moved from one location to another.

Use the following CLI syntax to move files:

CLI Syntax:
# file>
# move old-file-url new-file-url [force]
Example:
A:ALA-1>file cf1:\test1\test2\test3\ # move test.cfg
cf1:\test1
cf1:\test1\test2\test3\test.cfg
A:ALA-1>file cf1:\test1\test2\test3\ # cd ..
A:ALA-1>file cf1:\test1\test2\ # cd ..
A:ALA-1>file cf1:\test1\ # dir
Directory of cf1:\test1\
    05/04/2006 07:58a      <DIR>          .
    05/04/2006 07:06a      <DIR>          ..
    05/04/2006 07:06a      <DIR>          test2
    05/04/2006 07:58a               25278 test.cfg
     1 File(s)                  25278 bytes.
     3 Dir(s)                 1056256 bytes free.
A:ALA-1>file cf1:\test1\ #

2.2.6. Deleting Files and Removing Directories

Use the delete and rd commands to delete files and remove directories. Directories can be removed even if they contain files and/or subdirectories. To remove a directory that contains files and/or subdirectories, use the rd rf command. When files or directories are deleted, they cannot be recovered.

The force option deletes the file or directory without prompting the user to confirm.

Use the following CLI syntax to delete files and then remove directories:

CLI Syntax:
file#
delete file-url [force]
rd file-url [force]

The following displays an example of the command syntax:

A:ALA-1>file cf1:\test1\ # delete test.cfg
A:ALA-1>file cf1:\test1\ # delete abc.cfg
A:ALA-1>file cf1:\test1\test2\ # cd test3
A:ALA-1>file cf1:\test1\test2\test3\ # cd ..
A:ALA-1>file cf1:\test1\test2\ # rd test3
A:ALA-1>file cf1:\test1\test2\ # cd ..
A:ALA-1>file cf1:\test1\ # rd test2
A:ALA-1>file cf1:\test1\ # cd ..
A:ALA-1>file cf1:\ # rd test1
A:ALA-1>file cf1:\ #

Use the following CLI syntax to remove a directory without first deleting files or subdirectories:

CLI Syntax:
file
rd file-url rf

2.2.7. Unzipping Files

Use the unzip command to expand the contents of a ZIP file to the local file system. Any file that is zipped using the store, deflate, or zip64 compression methods can be unzipped. An example is the SR OS software image available from the Nokia customer support portal.

The source ZIP file location can be a locally installed solid-state storage device or a remote FTP or TFTP server.

The create-destination keyword ensures that any non-existent directory structure that is explicitly entered as the destination file URL is created as part of the unzip operation. This parameter is required to create new directories.

Note:

  1. The destination for the unzipped files and directories must be a locally installed solid-state storage device in the active CPM.
  2. ZIP filenames, or the filenames of any contained files, must not include special characters.

To unzip files, use the following CLI syntax:

CLI Syntax:
file>
unzip source-file-url [dest-file-url] list
unzip source-file-url dest-file-url [create-destination] [force]

The following example displays the unzip command syntax:

A:test# file unzip demo.zip cf3:/mynewfolder/mynewsubfolder create-destination force
Verifying cf3:\demo.zip .. ... OK
Unzipping cf3:\demo.zip to cf3:\mynewfolder\mynewsubfolder\ .. .Processing demodir/
Processing demodir/myfile1.txt
Processing demodir/myfile2.txt
Processing demodir/demosubdir/
Processing demodir/demosubdir/myfile3.txt
Writing...OK

2.2.8. Repairing the File System

Use the repair command to check a compact flash device for errors and repair any errors found.

Use the following CLI syntax to check and repair a compact flash device:

CLI Syntax:
file
repair [cflash-id]

The following example shows the command syntax:

A:ALA-1>file cf3:\ # repair 
Checking drive cf3: on slot A for errors...
Drive cf31: on slot A is OK.

2.3. File Management Tasks in the MD-CLI

The following sections are basic system tasks that can be performed in the MD-CLI.

For more information about the supported MD-CLI commands, refer to the 7450 ESS, 7750 SR, and 7950 XRS MD-CLI Command Reference Guide.

When a file system operation is performed that can potentially remove or overwrite a file system entry, a prompt appears to confirm the action. The force keyword performs the operation without displaying the confirmation prompt.

All the commands can operate on the local file system. Table 5 indicates which commands also support remote file operations.

Table 5:  File Command Local and Remote File System Support 

Command

local-url

ftp-url

tftp-url

http-url

https-url

change-directory

checksum

copy

list

make-directory

move

permission

remove

remove-directory

show

unzip

source only

source only

version

2.3.1. Displaying Directory and File Information

Use the list command to list the files on a file system, with an option to indicate the list order based on the date, name, or size of the files. The show command displays the contents of a specified file or multiple files. The version command displays the version of an SR OS image file.

Use the following CLI syntax to display directory and file information:

— file
— list [[sort-order] {date | name | size}] [[url] string]
— show [[url] string]
— version [url] string

The following shows an example of the command syntax:

[/file "cf3:\"]
A:admin@node-2# list
 
Volume in drive cf3 on slot A is .
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\
 
09/01/2020  11:27p      <DIR>          .ssh/
01/01/1980  12:00a                 170 NVRAM.DAT
01/01/1980  12:00a                 679 bof.cfg
09/01/2020  11:27p                 319 nvsys.info
09/01/2020  11:27p                   1 restcntr.txt
09/02/2020  04:32p      <DIR>          tstdir/
               4 File(s)                   1169 bytes.
               2 Dir(s)                       0 bytes free.
 
[/file "cf3:\"]
A:admin@node-2# list size
 
Volume in drive cf3 on slot A is .
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\
 
09/01/2020  11:27p      <DIR>          .ssh/
09/02/2020  04:32p      <DIR>          tstdir/
09/01/2020  11:27p                   1 restcntr.txt
01/01/1980  12:00a                 170 NVRAM.DAT
09/01/2020  11:27p                 319 nvsys.info
01/01/1980  12:00a                 679 bof.cfg
               4 File(s)                   1169 bytes.
               2 Dir(s)                       0 bytes free.
[/file "cf3:\"]
A:admin@node-3# show md-config.cfg
File: md-config.cfg
-------------------------------------------------------------------------------
configure {
    card 1 {
        mda 1 {
        }
    }
    log {
        filter 1001 {
            entry 10 {
                description "Collect only events of major severity or higher"
                action forward
                match {
                    severity {
                        gte major
                    }
                }
            }
        }
        log-id 99 {
            description "Default System Log"
            source {
                main true
Press Q to quit, Enter to print next line or any other key to print next page.

2.3.2. Modifying File Attributes

The system administrator can change the attribute of a local file or files in a directory.

Enter the permission command with no options to display the contents of the directory and the file attributes.

— file
— permission [[attribute] {read-only| read-write}] [[url] string]

A single local file can be specified or the wildcard character (*) can be used to indicate multiple files. If no URL is specified, the command applies to all files in the directory.

The following shows an example of the command syntax. A file with an “R” preceding the filename indicate the file is read-only; otherwise, the file is read-write.

[/file "cf3:\"]
A:admin@node-2# permission
            cf3:\NVRAM.DAT
            cf3:\bof.cfg
            cf3:\nvsys.info
            cf3:\restcntr.txt
            cf3:\.ssh
            cf3:\my.txt
 
[/file "cf3:\"]
A:admin@node-2# permission read-only my.txt
 
[/file "cf3:\"]
A:admin@node-2# permission
            cf3:\NVRAM.DAT
            cf3:\bof.cfg
            cf3:\nvsys.info
            cf3:\restcntr.txt
            cf3:\.ssh
 R          cf3:\my.txt
[/file "cf3:\"]
A:admin@node-2# permission read-only
 
[/file "cf3:\"]
A:admin@node-2# permission
 R          cf3:\NVRAM.DAT
 R          cf3:\bof.cfg
 R          cf3:\nvsys.info
 R          cf3:\restcntr.txt
 R          cf3:\.ssh
 R          cf3:\my.txt

2.3.3. Creating and Navigating Directories

New directories can be created in the local file system, one level at a time.

Use the make-directory command to create a new directory.

The change-directory command navigates to different directories.

— file
— change-directory [url] string
— make-directory [url] string

The following example shows the creation of three levels of directories.

[/file "cf3:\"]
A:admin@node-2# make-directory test1
 
[/file "cf3:\"]
A:admin@node-2# change-directory test1
 
[/file "cf3:\test1"]
A:admin@node-2# make-directory test2
 
[/file "cf3:\test1"]
A:admin@node-2# change-directory test2
 
[/file "cf3:\test1\test2"]
A:admin@node-2# make-directory test3
 
[/file "cf3:\test1\test2"]
A:admin@node-2# change-directory test3
 
[/file "cf3:\test1\test2\test3"]
A:admin@node-2# change-directory ..
 
[/file "cf3:\test1\test2"]
A:admin@node-2#

2.3.4. Copying Files

A variety of files and file types, including image files and configuration files, can be uploaded or downloaded to and from flash cards or TFTP servers.

Use the copy command to copy files.

— file
— copy [source-url] string [destination-url] string [client-tls-profile string] [direct-http] [force] [proxy string]

The following example copies the md-config.cfg file to the test1 directory.

[/file "cf3:\"]
A:admin@node-2# list test1
...
04/05/2019  09:36a                 167 nvram.dat-9
08/19/2020  06:05p                 320 nvsys.info
04/16/2014  10:15a      <DIR>          syslinux/
09/01/2020  08:13p      <DIR>          test1/
04/16/2014  10:15a      <DIR>          timos/
              27 File(s)                  45399 bytes.
               4 Dir(s)                10668032 bytes free.
[/file "cf3:\"]
A:admin@node-2# copy md-config.cfg test1
1 file copied.
 
[/file "cf3:\"]
A:admin@node-2# list test1
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/02/2020  07:48p               11401 md-config.cfg
09/01/2020  08:13p      <DIR>          test2/
               1 File(s)                  11401 bytes.
               3 Dir(s)                10656256 bytes free.

2.3.5. Moving Files

Files or directories can be moved from one location to another.

Use the following CLI syntax to move files:

— file
— move [source-url] string [destination-url] string [client-tls-profile string] [direct-http] [force] [proxy string]

The following example moves the md-config.cfg file to the test1/test2 directory.

[/file "cf3:\test1\"]
A:admin@node-2# list cf3:\test1/test2
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1\test2
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
09/04/2020  06:35p               11788 my_test.cfg
09/04/2020  06:43p      <DIR>          test3/
               2 File(s)                  12662 bytes.
               3 Dir(s)                10629632 bytes free.
 
[/file "cf3:\test1\"]
A:admin@node-2# move md-config.cfg test2
Moving file cf3:\test1\md-config.cfg ... OK
cf3:\test1\md-config.cfg
 
[/file "cf3:\test1\"]
A:admin@node-2# change-directory test2
 
[file "cf3:\test1\test2"]
A:admin@node-2# list
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1\test2
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
04/28/2020  03:15p               11401 md-config.cfg
09/04/2020  06:35p               11788 my_test.cfg
09/04/2020  06:43p      <DIR>          test3/
               3 File(s)                  24063 bytes.
               3 Dir(s)                10629632

2.3.6. Deleting Files and Removing Directories

Use the remove and remove-directory commands to delete files and remove directories. Directories can be removed even if they contain files or subdirectories.

Use the following CLI syntax to delete files and then remove directories:

— file
— remove [url] string [client-tls-profile string] [direct-http] [force] [proxy string]
— remove-directory [url] string [force] [recursive]

The following example removes the test1/test2/test3 directory.

[/file "cf3:\test1\test2"]
A:admin@node-2# list
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1\test2
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
04/28/2020  03:15p               11401 md-config.cfg
09/04/2020  06:43p      <DIR>          test3/
               2 File(s)                  12275 bytes.
               3 Dir(s)                10641920 bytes free.
 
[/file "cf3:\test1\test2"]
A:admin@node-2# list test3
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1\test2\test3
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:43p               11788 conf3.cfg
09/04/2020  04:24p                6645 mybof.cfg
               2 File(s)                  18433 bytes.
               2 Dir(s)                10641920 bytes free.
 
[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 ?
 
 remove-directory
 force                 - Force removal without prompting
 recursive             - Remove directory and its content recursively
 
[/file "cf3:\test1\test2"]
A:admin@node-2# remove-directory test3 recursive
Deleting all subdirectories and files in specified directory. y/n ?y
Deleting file cf3:\test1\test2\test3\mybof.cfg ... OK
Deleting file cf3:\test1\test2\test3\conf3.cfg ... OK
Deleting directory cf3:\test1\test2\test3 ... OK
 
[/file "cf3:\test1\test2"]
A:admin@node-2# list
 
Volume in drive cf3 on slot A is TIMOS_VM_CF.
 
Volume in drive cf3 on slot A is formatted as FAT32
 
Directory of cf3:\test1\test2
 
09/01/2020  08:13p      <DIR>          ./
09/01/2020  08:13p      <DIR>          ../
09/04/2020  06:36p                 874 bof.cfg
04/28/2020  03:15p               11401 md-config.cfg
               2 File(s)                  12275 bytes.
               2 Dir(s)                10661376 bytes free.

2.3.7. Unzipping Files

Use the unzip command to expand the contents of a ZIP file to the local file system. Any file zipped using the store, deflate, or zip64 compression methods can be unzipped. An example is the SR OS software image available from the Nokia customer support portal.

The source ZIP file location can be a locally installed solid-state storage device or a remote FTP or TFTP server.

The create-destination keyword ensures that any non-existent directory structure that is explicitly entered as the destination file URL is created as part of the unzip operation. This parameter is required to create new directories.

Note:

  1. The destination for the unzipped files and directories must be a locally installed solid-state storage device in the active CPM.
  2. ZIP filenames, or the filenames of any contained files, must not include special characters.

To unzip files, use the following CLI syntax:

— file
— unzip [source-url] string [[destination-url] string] [create-destination] [force] [list]

The following example shows the command syntax:

[/file "cf3:\"]
A:admin@node-2# unzip demo.zip cf3:/mynewfolder/mynewsubfolder create-destination
   force
Verifying cf3:\demo.zip .. ... OK
Unzipping cf3:\demo.zip to cf3:\mynewfolder\mynewsubfolder\ .. .Processing demodir/
Processing demodir/myfile1.txt
Processing demodir/myfile2.txt
Processing demodir/demosubdir/
Processing demodir/demosubdir/myfile3.txt
Writing...OK

2.3.8. Repairing the File System

Use the repair command to check a compact flash device for errors and repair any errors found.

Use the following CLI syntax to check and repair a compact flash device:

— file
— repair [[cflash-id] string]

The following example shows the command syntax:

[/file "cf3:\"]
A:admin@node-2# repair cflash-id cf3:
Checking drive cf3: on slot A for errors...
Drive cf3: on slot A is OK.
 
[/file "cf3:\"]
A:admin@node-2# repair
Checking drive cf3: on slot A for errors...
Drive cf3: on slot A is OK.

2.3.9. Displaying File Checksums

Use the checksum command to display file checksums of an SR OS image file.

Use the following CLI syntax to display checksums:

— file
— checksum type [url] string

The following example shows the command syntax:

[/file "cf3:\"]
A:admin@node-2# checksum image cpm.timTiMOS-C-20.10.R1
Wed Nov 4 09:18:17 PST 2020 by builder in /builds/c/2010B/R1/panos/main/sros
Checking file ... OK