User guide

Managing System Files File and Directory Management
OmniSwitch AOS Release 7 Switch Management Guide March 2015 page 3-9
Removing a Directory and its Contents
The rmdir command removes the specified directory and all its contents. The following command would
remove the dir1 directory.
->rmdir /flash/dir1
or
->rm -rf /flash/dir1
File Commands
The file commands apply to files located in the /flash file directory and its sub-directories.
Creating or Modifying Files
The switch has an editor for creating or modifying files. The editor is invoked by entering the vi command
and the name of the new file or existing file that you want to modify. For example:
-> vi /flash/my_file
This command puts the switch in editor mode for my_file. If my_file does not already exist, the switch
will create the file in the flash directory. In the editing mode, the switch uses command keystrokes similar
to any vi UNIX text editor. For example, to quit the edit session and save changes to the file, type ZZ.
Copy an Existing File
Use the cp command to copy an existing file. You can specify the path and filename for the original file
being copied as well as the path and filename for the new copy being created. If no path is specified, the
command assumes the current directory.
For example:
->cp /flash/dir1/sourcefile.img /flash/certified
->cp sourcefile.img /flash/certified
->cp /flash/dir1/sourcefile.img newfile.img
Secure Copy an Existing File
Use the scp command to copy an existing file in a secure manner. You can specify the path and filename
for the original file being copied as well as the path and filename for a new copy being created. If no path
is specified, the command assumes the current directory. The following syntax copies all of the image files
in the working directory from a remote switch to the local working directory:
-> scp admin@198.51.100.1:/flash/working/*.img /flash/working
admin's password for keyboard-interactive method:
This second example helps copy all the image files from the user’s current working directory to the
remote switch’s working directory. A copy of all the image files will appear in the /flash/working direc-
tory of the remote switch, once the following command is executed.
-> scp /flash/working/*.img admin@198.51.100.1:/flash/working
admin's password for keyboard-interactive method: