DEV Community

Discussion on: Basic UNIX commands

Collapse
 
emcain profile image
Emily Cain • Edited

Great post Jérémy!

Some more:

ps aux will show you the running processes.

netstat will show you the open network ports.

Both of these will have a very large output, so combine with grep to filter for a specific string:

$ ps aux | grep mysql is a good way to see what process represents a MySQL instance, for example.

NOTE: the $ is conventionally used to represent the start of a command you type into your bash terminal and run with return or enter. You don't type out the $ character.

This is useful when your application is not running as expected and you want to check than any requried processes have been started.

You can use this to figure out what is running on a particular port (and kill it if desired):

stackoverflow.com/questions/115835...

I end up using these a lot when working with introductory web development students -- they don't know how to check what is running, end up starting 2 or more instances of a server process, and then get confused when they can't connect to their web application.