Commands For File System

1.6 File System Commands

1.6.1 cd

Command: cd <directory>
Function: Change the working directory for the storage device.
Parameter:

  • <directory>: sub-directory name, a sequence of consecutive characters whose length ranges from to 80.

Command mode: Admin Mode
Default: The default working directory is Flash.
Usage guide: After executing this command, the current storage device will switch to the new working directory, which can be viewed by the ?pwd? command.
Example: Change the working directory of the current storage device to flash.

active500EM#cd flash:
active500EM#pwd
flash:
active500EM#

 

1.6.2 copy

Command: copy <source-file-url > <dest-file-url>
Function: Copy a designated file on the switch and store it as a new file.
Parameters:

  • <source-file-url>: source file.
  • <dest-file-url>: destination file. Formatting requirements of the URLs of the source and destination files modified in IMG mode and stored in backup master board and line cards, are as follows:
  • The prefix of the source file URL should be in one of the following forms:
    • ?ftp://username:pass@server-ip/file-name?
    • ?tftp://server-ip/file-name?
  • The prefix of the destination file URL should be in one of the following forms:
    • ?ftp://username:pass@server-ip/file-name?
    • ?tftp://server-ip/file-name?

Command mode: Admin Mode
Default: None.
Usage guide: 1. In this command, if the prefix of the source file URL is ftp:// or tftp:// the destination file cannot have that same prefix of ftp:// or tftp://.
2. To use this command, the designated source file should exist and the destination file should not have the same name as any existing directory or file. If an existing file with the same name does exist, there might be a prompt warning referencing a failed copy operation or an attempt to overwrite an existing file.
3. With this command enabled, users can copy files from other directories into the current one if the source and destination files are located in different directories.
URL Example: The URL of files in the root directory of Flash devices should be updated to flash:/nos.img.
Example: Copy the file ?flash:/nos.img? and store it as ?flash/nos-6.1.11.0.img?.

active500EM#copy flash:/nos.img flash:/nos-6.1.11.0.img
Copy flash:/nos.img to flash:/nos-6.1.11.0.img? [Y:N] y
Copied file flash:/nos.img to flash:/nos-6.1.11.0.img.

 

1.6.3 delete

Command: delete <file-url>
Function: Delete the designated file on the storage device.
Parameter:

  • <file-url>: full path of the file to be deleted.

Command mode: Admin Mode
Default: None.
Usage guide: The designated file will be deleted after implementing this command.
Example: Delete file flash:/nos.img.

active500EM#delete flash:/nos5.img
Delete file flash:/nos5.img?[Y:N]y
Deleted file flash:/nos.img.

 

1.6.4 dir

Command: dir [WORD] Function: Display the information of the designated directory on the storage device.
Parameter:

  • <WORD>: name of the directory displayed. Available formats include: directory name, slotxx# directory name, flash:/directory name, and cf:/directory name.

Command mode: Admin Configuration Mode
Default: No <WORD> means to display information of the current working directory..
Usage guide: Implementing this command will display information of files and sub-directories in the designated directory.
Note: This command does not support a recursive display of all sub-directories.
Example: Display information for the directory ?flash:/?.

active500EM#dir flash:
-rwx        48              default-license.lic
-rwx        245             dh1024.pem
-rwx        156             dh512.pem
-rwx        14.6M           nos.img
-rwx        24              portal-locale.cfg
-rwx        1.5K            startup.cfg
-rwx        2.4K            test
-rwx        0               wlan.pem
-rwx        245             wsdh1024.pem
-rwx        156             wsdh512.pem
-rwx        928             wssl2-cert.pem
-rwx        912             wssl2-key.pem
Drive : flash:
Size:26.5M  Used:14.7M  Available:11.8M  Use:55%

 

1.6.5 format

Command: format <device>
Function: Format the storage device.
Parameter:

  • <device>: name of the device to be formatted.

Command mode: Admin Mode.
Default Settings: None.
Usage guide:
1. After formatting, all files on the storage device will be irrecoverably lost.
2. The only acceptable file system type of Format is FAT 32.
3. This command cannot be used to format flash.
Example: Format the storage device.

 format active500EM

 

1.6.6 mkdir

Command: mkdir <directory>
Function: Create a sub-directory in the designated directory on a certain storage device .
Parameter:

  • <directory>: sub-directory name, a sequence of consecutive characters, whose length ranges from 1 to 80.

Command mode: Admin Mode.
Default Settings: None.
Usage guide: The new created directory should not be named the same as any other directory or file in the designated directory, or located on a flash device. If any error occurs, a prompt will be displayed.
Example: Create a subdirectory named ‘test’.

active500EM#mkdir test

 
 

1.6.7 pwd

Command: pwd
Function: Display the current working directory.
Parameters: None.
Command mode: Admin Mode
Default: The default directory is flash.
Usage guide: Display the current working directory.
Example: Display the current working directory.

active500EM#pwd
flash:/
active500EM#

 

1.6.8 rename

Command: rename <source-file-url> <new-filename >
Function: Rename a designated file on the AP.
Parameter:

  • <source-file-url>: source file. The path of the source file is not required.
  • <new-filename>: filename without a specified path.

Command mode: Admin Mode
Default: None
Usage guide: The rename command is used when the new file name does not exist in a directory or file. If the file name does exist in an existing directory or file, an error prompt will display.
Example: Change the name of file ?nos.img? in the current working directory to ?nos-6.1.11.0.img?.

active500EM#rename nos.img nos-6.1.11.0.img
Rename flash:/nos.img to flash:/nos-6.1.11.0.img ok!

 

1.6.9 rmdir

Command: rmdir <directory>
Function: Delete a sub-directory in the designated directory on a certain device.
Parameter:

  • <directory>: sub-directory name, a sequence of consecutive characters whose length ranges from 1 to 80.

Command mode: Admin Mode.
Default Settings: None.
Usage guide: The directory to be deleted should exist and be empty. All files in the directory should be deleted before deleting the directory, or an error prompt will be displayed.
Example: Delete a subdirectory named ‘test’.

 active500EM#rmdir test

 


Return to Controller Wired CLI Table of Contents