Chapter 10 Install and System Administration for FortiOS 5.0 : Using the CLI : Sub-commands
  
Sub-commands
Each command line consists of a command word that is usually followed by words for the configuration data or other specific item that the command uses or affects:
get system admin
Sub-commands are available from within the scope of some commands.When you enter a sub-command level, the command prompt changes to indicate the name of the current command scope. For example, after entering:
config system admin
the command prompt becomes:
(admin)#
Applicable sub-commands are available to you until you exit the scope of the command, or until you descend an additional level into another sub-command.
For example, the edit sub-command is available only within a command that affects tables; the next sub-command is available only from within the edit sub-command:
config system interface
edit port1
set status up
next
end
Sub-command scope is indicated by indentation. See “Indentation”.
Available sub-commands vary by command.From a command prompt within config, two types of sub-commands might become available:
commands affecting fields
commands affecting tables
 
Table 61: Commands for tables
clone <table>
Clone (or make a copy of) a table from the current object.
For example, in config firewall policy, you could enter the following command to clone security policy 27 to create security policy 30:
clone 27 to 39
In config antivirus profile, you could enter the following command to clone an antivirus profile named av_pro_1 to create a new antivirus profile named av_pro_2:
clone av_pro_1 to av_pro_2
clone may not be available for all tables.
delete <table>
Remove a table from the current object.
For example, in config system admin, you could delete an administrator account named newadmin by typing delete newadmin and pressing Enter. This deletes newadmin and all its fields, such as newadmin’s first-name and email-address.
delete is only available within objects containing tables.
edit <table>
Create or edit a table in the current object.
For example, in config system admin:
edit the settings for the default admin administrator account by typing edit admin.
add a new administrator account with the name newadmin and edit newadmin‘s settings by typing edit newadmin.
edit is an interactive sub-command: further sub-commands are available from within edit.
edit changes the prompt to reflect the table you are currently editing.
edit is only available within objects containing tables.
In objects such as security policies, <table> is a sequence number. To create a new entry without the risk of overwriting an existing one, enter edit 0. The CLI initially confirms the creation of entry 0, but assigns the next unused number after you finish editing and enter end.
end
Save the changes to the current object and exit the config command. This returns you to the top-level command prompt.
get
List the configuration of the current object or table.
In objects, get lists the table names (if present), or fields and their values.
In a table, get lists the fields and their values.
For more information on get commands, see the CLI Reference.
purge
Remove all tables in the current object.
For example, in config forensic user, you could type get to see the list of user names, then type purge and then y to confirm that you want to delete all users.
purge is only available for objects containing tables.
Caution: Back up the FortiGate unit before performing a purge. purge cannot be undone. To restore purged tables, the configuration must be restored from a backup.
Caution: Do not purge system interface or system admin tables. purge does not provide default tables. This can result in being unable to connect or log in, requiring the FortiGate unit to be formatted and restored.
rename <table> to <table>
Rename a table.
For example, in config system admin, you could rename admin3 to fwadmin by typing rename admin3 to fwadmin.
rename is only available within objects containing tables.
show
Display changes to the default configuration. Changes are listed in the form of configuration commands.
See Also
Example of table commands
Connecting to the CLI
Sub-commands
Permissions
Tips