0

How to know the PID of the last open file (process) using the command line?

muru
  • 193,181
  • 53
  • 473
  • 722
Maythux
  • 82,867
  • 54
  • 239
  • 271

1 Answers1

1

The PID of the last process started from the terminal can be found in the ! variable:

gedit &
echo $!
Maythux
  • 82,867
  • 54
  • 239
  • 271
Knotgrund
  • 46
  • 3