Remote Shell Commands for Mac Endpoints

Use the available remote shell commands to investigate Mac endpoints.

Command

Description

Syntax

Example

cat

Output the content of the selected file (max size 1MB)

cat <file_location>

  • To output the content of the example.txt file located in the current directory (/Users/admin/Downloads):

    Downloads>cat example.txt

  • To output the content of the example.txt file located in the /tmp directory:

    Downloads>cat /tmp/example.txt

cd

Change the current working directory

cd [path]

Note:

For the <path>, specify the absolute or relative path.

cd /Users

clear

Clear screen

clear

clear

cp

Copy a file or directory to specific destination

cp <source_object> <destination_object> [--force]

  • To copy the Finances directory in the current directory /Users/admin/Downloads to /tmp and overwrite the existing directory:

    Downloads>cp Finances /tmp --force

  • To copy the example.txt file in the directory /var to /tmp and overwrite the existing example.txt file:

    Downloads>cp /var/example.txt /tmp --force

env

List environment variables

env

env

fileinfo

List detailed file properties

fileinfo <file_location_and_extension>

  • To list the file properties of the example.txt file in the current directory /Users/admin/Downloads :

    Downloads>fileinfo example.txt

  • To list the file properties of the example.txt file located in the /tmp directory:

    Downloads>fileinfo /tmp/example.txt

get

Collect a specific file and upload to Trend Micro Vision One

Maximum file size: 4 GB

get <file_location_and_extension>

  • To collect the file example.txt file in the current directory /Users/admin/Downloads :

    Downloads>get example.txt

  • To collect the file example.txt file located in the /tmp directory:

    Downloads>get /tmp/example.txt

help

Display help information

help

help

ipconfig

Display network configuration information

ipconfig

ipconfig

kill

Terminate a running process

kill <PID>

kill 1234

ls

List contents of the directory

ls [path]

Note:

For the <path>, specify the absolute or relative path.

ls

mkdir

Create a new directory

mkdir <path>

  • To create the Finances directory in the current directory /Users/admin/Downloads :

    Downloads>mkdir Finances

  • To create the Finances directory in the /tmp directory:

    Downloads>mkdir /tmp/Finances

mv

Move a file or directory to specific destination

mv <source_object> <destination_object> [--force]

  • To move the Finances directory in the current directory /Users/admin/Downloads to /tmp and overwrite the existing directory:

    Downloads>mv Finances /tmp --force

  • To move the example.txt file in the directory /var to /tmp and overwrite the existing example.txt file:

    Downloads>mv /var/example.txt /tmp --force

netstat

List network statistics and active connections

netstat

netstat

ps

List running process information

ps

ps

pwd

Display current directory

pwd

pwd

rm

Delete a file or directory (and all sub-directories)

rm <source_object> [--force]

  • To delete the Finances directory in the current directory /Users/admin/Downloads :

    Downloads>rm Finances

  • To delete the example.txt file in the directory /var :

    Downloads>rm /var/example.txt

service list

List service information

service list

service list

systeminfo

List system information

systeminfo

systeminfo

user info

List account properties

user info <username>

user info john_doe

user list

List local user accounts

user list

user list

zip

Compress a file or directory in a zip archive and optionally encrypt the archive with a password

zip <source_object1> [<source_object2...> <source_objectn>] <destination_object> [--password <password>] [--force]

  • To zip the contents of the Finances directory in the current directory /Users/admin/Downloads to /tmp/directoryArchive.zip , set password to "P@ssw0rd" and overwrite the existing file:

    Downloads>zip Finances /tmp/directoryArchive.zip --password P@ssw0rd --force

  • To zip the example.txt file in the directory /var to /tmp/exampleArchive.zip and overwrite the existing file:

    Downloads>zip /var/example.txt /tmp/exampleArchive.zip --force