This Guide contains all the Linux commands that you may have to use for ThingWorx Analytics Installation or day to day use.






ip a

List the ips of all of the network interfaces


How to jump from one machine to another


Send packets to a remote machine.  useful for testing connectivity

netstat –anp

Check active port

cat < /dev/tcp/localhost/8080

Test connection to a port

Replace localhost with desired hostname or ip, replace 8080 with desired port number



Exit my current sign in.  this lets one disconnect from remove ssh sessions or if one has changed one's user e.g. switched to root


Retrieve something via ssh

Resource Usage


free -m

Check memory

-m is for output in Mb

Mpstat -P ALL

CPU usage


Process usage


Collect cpu usage of jvm and its thread

(requires jdk to be installed)

File Interaction


cp / mv

Copy and move respectively. mv just deletes the source file.  Usage: cp /source/location/file /output/location/file


  1. Mostly used to just print the contents of a file to the command line.  can also print multiple files at once:  cat /var/log/gridworker/warning.log /var/log/gridworker/error.log

vim / vi

A command line text editor. Not the most user friendly (none of them are) but really useful. Here's a cheat sheet for the commands


Remove files


Change the access permissions of files


Change the user or group ownership of files


A text based filtering.  Useful for making a larger list smaller and more targeted.  Almost always used after a pipe (see pipe below)


Generally used to view the contents of a file with more friendly scrolling


Find a file by name




What’s in the directory.  Will do the current directory but you can also pass the directory e.g. ls /var/log/tomcat.

  • Black writing is files
  • Blue writing is directories
  • Red writing is compressed file


Tell me which directory I'm currently in


Change directory.  provide the directory to change to or just use cd to return to the user's home directory


Clears the screen Terminal clears all provided commands


Creates Directories

Running Processes



Query what services are running. usually use ps -aux to get a full, sorted list.  using grep with this is helpful


The correct way to interact with services that are running

Package installation


yum install <packageName>

Install a package. More useful commands:

yum list installed

List installed packages

yum list <package>

List available packages

yum --showduplicates list java-1.7.0-openjdk-devel

Use --showduplicates to see all versions

Can use * for package name: *openjdk*

rpm -ql <packagename>

Find where package are installed

Note: works if package installed with yum

Yumdownloader --urls <packageName>

Find URL where a package is downloaded from.

Note: need to install yum-utils package

Repoquery --requires <packageName>

Find dependencies of a package

Note: need to install yum-utils package

repoquery --qf=%{name} -g --list --grouppkgs=all [groups] | xargs repotrack -a x86_64 -p /repos/Packages

Download a package with all its dependencies. Need to install yum-utils package From  <>

Other Commands


curl http://localhost:8080/1.0/about/versioninfo

Send REST call via command line

Use -X POST (default GET) for a POST (see man

page - for example)

See also

Find / -type f -exec grep -I mystring {} \;

Search string in files

Sudo -u user command

Execute a command as different user




The below helpers are not commands themselves, but can be used in conjunction with the above commands.




The | character.  lets one chain commands.  e.g. ps -aux | grep java


The shorthand way to refer to this directory explicitly


The shorthand way to refer to the parent directory

'tab completion'

Pressing tab will let linux guess what command/option best fits what's currently written.  very useful for navigating directories and long-named files (NOTE: not necessarily tab based upon one's keyboard layout/language)


Look up the mostly likely command that matches what one typing.  so if one earlier used ps -aux | grep java | less and the hit ctrl-r and typed -aux it would likely pull that command or at least the most recent one that matches