Skip to content

Instantly share code, notes, and snippets.

@kellthenoise
Created December 12, 2018 18:32
Show Gist options
  • Save kellthenoise/1ebf52a47bac4ea73de8f3d2052227c1 to your computer and use it in GitHub Desktop.
Save kellthenoise/1ebf52a47bac4ea73de8f3d2052227c1 to your computer and use it in GitHub Desktop.
To list open files (process id’s and ports, actually):
sudo lsof -i -P
To avoid text wrapping, pull the right edge to expand the screen width.
The right-most column heading "Name" shows the port (either TCP or UDP).
To filter a particular port number:
sudo lsof -i -P | grep 8080
The second column, PID, lists the process identifier. Copy a number for use in the kill command:
sudo kill 289
.dmg (Disk Image) files can be mounted from the command line:
hdiutil attach /path/to/diskimage.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment