Script Commands for Linux Devices
Use the options and examples below to help you create your own powerful script commands.
All Linux supported scripts can be run on Linux devices. You can also use the options and examples below to help you create your own powerful script commands.
Legend
Format | Meaning |
---|---|
text |
Enter the command exactly as shown. |
text |
Replace with the requested information. |
[text] | Information contained within square brackets is optional to the command. |
text|text |
Choose one of the options separated by the vertical pipe. |
Commands
Command | Syntax |
---|---|
cd
Changes the current directory. |
cd [directory]
Example To change to the Chocolate directory:
|
copy or cp
Copies one or more files to another location. |
copy source
destination
Example To copy all files with the extension .txt from the /etc/passwd directory to the /etc/group directory on the device: cp /etc/passwd/*.txt /etc/group |
connect
Prompts the device agent to try to connect to the deployment server. |
./mobicontrol -connect |
del
Deletes a file or folder. |
del filename
Example To delete a file named skittles.jpg:
To delete all files with the extension .jpg in the current directory:
To delete a file named skittles.jpg, forcefully:
To delete a folder named Wrigley:
|
disconnect
Prompts the device agent to disconnect from the deployment server. Note: This can only be applied when the Manual
connection setting is enabled.
|
./mobicontrol -disconnect |
halt
Shuts down the device. |
sudo halt |
man
Displays the manual for a command. |
man command
Example To learn more about the
|
mkdir or md
Creates a new directory. |
mkdir [drive:] path
Example To create a directory named "test" from the current directory:
To create
|
move
Moves a file from specified source location to specified destination location. Note: You can rename the file at the
same time by specifying a name for the destination
filename.
|
move [sourceFilePath]
filename
destinationFilePath
[filename]
Example To move the file test.txt:
To move and rename a file at the same time:
To move folder to root folder:
|
reboot
Reboots the device. |
sudo reboot |
reset
Performs a soft or hard reset of the device. |
reset [/S] [/delay sec]
Where:
Example To soft reset a device after a 30 second delay:
|
rm
Deletes a file or folder. |
rm filename
Example To delete a file named skittles.jpg:
To delete all files with the extension .jpg in the current directory:
To delete a file named skittles.jpg, forcefully:
To delete a folder named Wrigley:
|
rmdir or rd
Deletes a directory. |
rmdir [/S] path
Where On
Android Plus and Linux devices, this command requires the
Example To remove an empty directory named "test" from the current directory:
To remove a directory named "test" and all of its contents from the current directory:
To provide location:
|
setdate
Sets the date and time. |
setdate date [time]
Where Example To set the date and time of the device
|
shell
Launches the Linux shell. |
shell |
turnoff
Reboots the device. You can specify a delay (in milliseconds) before the device reboots. |
turnoff [time]
Example To turn off the device in 3.5 seconds:
|
writeprivateprofstring
Saves or deletes specified settings on a device. See The writeprivateprofstring Command for more information. |