2022-01-16 18:20:39 +00:00
|
|
|
---
|
|
|
|
title: "processes"
|
2022-01-26 21:29:48 +00:00
|
|
|
tags: [ "Documentation", "Basics" ]
|
2022-01-16 18:20:39 +00:00
|
|
|
---
|
2020-01-02 00:04:35 +00:00
|
|
|
# Proccesses
|
|
|
|
|
|
|
|
See running items in current terminal with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
ps
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
or more with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
ps -a
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Or the entire system with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
ps -e
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Or the entire system with more information, BSD style, with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
ps aux
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
And then search for a particular program with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
ps aux | grep cmus
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
# Jobs
|
|
|
|
|
|
|
|
Pause a job with ^z. Put it in the background with the '&' suffix.
|
|
|
|
|
|
|
|
List jobs in the current shell with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
jobs
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
And then you can pull number 1 up again with
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
fg 1
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Or continue running a stopped job with:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
bg 1
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
# Nice
|
|
|
|
|
2020-01-02 17:40:18 +00:00
|
|
|
This changes how nice a program is, from -20 to 19.
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Install a program, but nicely, at nice value '10':
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
nice -10 sudo apt -y install libreoffice
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Aggressively use Steam, with a nice value of '-13'.
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
nice --13 steam&
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Find out that Steam's fucking everything up, so you change its nice value with 'renice':
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
renice --5 -p 3781
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Nerf all of roach-1's processes:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
renice 10 -u roach-1
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
... or the entire group
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
renice -14 -g hackers
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|