system - Run commands in a Linux shell on the NVIDIA hardware - MATLAB (original) (raw)

Main Content

Run commands in a Linux shell on the NVIDIA hardware

Syntax

Description

system([hwObj](#mw%5F5d1d1ba3-b9a9-471a-9203-939ed9bb6a2a%5Fsep%5Fmw%5Fbcc65819-faa5-4997-9bca-35a8da7d894a),[command](#mw%5F9795c183-7b77-477b-9f69-80ca962e7fbf)) runs a command in the Linux® command shell on NVIDIA® hardware. This function does not allow you to run interactive commands.

example

system([hwObj](#mw%5F5d1d1ba3-b9a9-471a-9203-939ed9bb6a2a%5Fsep%5Fmw%5Fbcc65819-faa5-4997-9bca-35a8da7d894a),[command](#mw%5F9795c183-7b77-477b-9f69-80ca962e7fbf),[sudo](#mw%5Fcf5db2b5-57ad-4dcc-a04f-8815528a5b98)) runs a command with superuser privileges.

example

Examples

collapse all

You can run a command that lists the contents of a folder.

ans =

'total 168
 drwxr-xr-x 19 ubuntu ubuntu  4096 Aug  9 16:02 .
 drwxr-xr-x  5 root   root    4096 Feb  3  2018 ..
 -rw-------  1 ubuntu ubuntu   263 Aug 13 22:33 .bash_history
 -rw-r--r--  1 ubuntu ubuntu   220 May  3  2016 .bash_logout
 -rw-r--r--  1 ubuntu ubuntu  3771 May  3  2016 .bashrc
 drwx------ 12 ubuntu ubuntu  4096 Aug  9 14:14 .cache
 drwx------ 14 ubuntu ubuntu  4096 Aug  9 14:14 .config
 drwxr-xr-x  2 ubuntu ubuntu  4096 Aug  9 14:13 Desktop
 -rw-r--r--  1 ubuntu ubuntu    25 Aug  9 14:13 .dmrc
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Documents
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Downloads
 drwx------  2 ubuntu ubuntu  4096 Aug  9 14:14 .gconf
 drwx------  3 ubuntu ubuntu  4096 Aug  9 14:13 .gnupg
 drwxrwxr-x  3 ubuntu ubuntu  4096 Aug  9 14:25 gpucoderTX2
 -rw-------  1 ubuntu ubuntu   346 Aug  9 14:13 .ICEauthority
 -rwxr-xr-x  1 ubuntu ubuntu 10238 Feb  3  2018 jetson_clocks.sh
 drwx------  3 ubuntu ubuntu  4096 May  6  2016 .local
 drwxr-xr-x  3 root   root    4096 Aug  9 14:06 MATLAB
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Music
 drwx------  3 ubuntu ubuntu  4096 Aug  9 14:13 .nv
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Pictures
 -rw-r--r--  1 ubuntu ubuntu   675 May  3  2016 .profile
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Public
 drwxrwxr-x  3 ubuntu ubuntu  4096 Aug  9 16:31 remoteBuildDir
 -rw-r--r--  1 ubuntu ubuntu     0 May  6  2016 .sudo_as_admin_successful
 -rwxr-xr-x  1 ubuntu ubuntu 39049 Feb  3  2018 tegrastats
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Templates
 drwxr-xr-x  2 ubuntu ubuntu  4096 May  6  2016 Videos
 -rw-r--r--  1 ubuntu ubuntu  2850 Feb  3  2018 weston.ini
 -rw-------  1 ubuntu ubuntu    57 Aug  9 14:13 .Xauthority
 -rw-------  1 ubuntu ubuntu   186 Aug  9 14:13 .xsession-errors
 -rw-------  1 ubuntu ubuntu  1178 May  6  2016 .xsession-errors.old
 '

You can run a command with superuser privileges.

system(hwObj,'cp /etc/network/interfaces int.copy','sudo')

Input Arguments

collapse all

Connection to a specific NVIDIA hardware board, specified as a jetson or drive object.

Linux command, specified as character vector.

Example: 'ls -al'

If the optional input, 'sudo', is specified as the third argument, the command is executed as super user.

Example: 'sudo'

Version History

Introduced in R2018b

See Also

Functions

Objects

Topics