<< Back to posts

Helpful Linux Commands

Posted on February 28, 2023 • Tags: linux terminal

A list of helpful Linux commands.

Localhost

List processes running on port 5000

lsof -i :5000

GPUs

List processes using Nvidia GPUs

fuser -v /dev/nvidia*
lsof /dev/nvidia*

Real-time GPU memory usage (pretty):

pip install gpustats
gpustat -cp --watch

Screen Shot 2023-02-28 at 2.28.47 PM

Real-time GPU memory usage (ugly):

watch -n0.1 nvidia-smi

Screen Shot 2023-02-28 at 2.29.14 PM

Memory

Size of every file/folder in the current directory:

du -hs * | sort -hr