Jump to content

Useful Commands

From SameTeem

Kill program from command line

Show all processes

ps aufx

Or search for a specific process name

ps aufx | grep firefox

Example output

user        7243 27.4  2.1 17807108 1413692 ?    Ssl  21:32  18:31  |   \_ /home/user/Desktop/firefox/firefox-bin

The second column is the process ID.

Some applications, pretty much any that use flatpak and any browser, will have multiple processes in a "tree" (see below), in these cases you may need to kill every process in the tree ("kill 3136 3607 3634") for things to fix themselves.

user        3136  0.0  0.0   3432  2292 ?        Ss   21:31   0:00  |   \_ bwrap --args 84 -- easyeffects
user        3607  0.0  0.0   3440  1728 ?        S    21:31   0:00  |   |   \_ bwrap --args 84 -- easyeffects
user        3634  9.0  0.3 1619592 249548 ?      SLl  21:31   6:26  |   |       \_ easyeffects

Gentle process kill (try this first), the app will be asked to exit nicely.

kill 7243

Still won't close? Hard Kill, data may be lost that wasn't saved to disk yet.

kill -9 7243

If all processes have the same name you can use "killall"

killall firefox-bin

How Much Space Is in Use?

df -h

Example output

The Filesystem with your system root is always /, some systems will have a separate /home filesystem.

Filesystem                                                              Size  Used Avail Use% Mounted on
tmpfs                                                                   3.2G  5.8M  3.2G   1% /run
efivarfs                                                                128K   52K   72K  42% /sys/firmware/efi/efivars
/dev/md3                                                                458G  336G   99G  78% /
tmpfs                                                                    16G  9.0M   16G   1% /dev/shm
tmpfs                                                                   5.0M     0  5.0M   0% /run/lock
/dev/md2                                                                2.0G  321M  1.6G  18% /boot
/dev/nvme0n1p1                                                          511M  344K  511M   1% /boot/efi
tmpfs                                                                   3.2G   16K  3.2G   1% /run/user/0

Disk space usage is also available graphically from the "Storage Devices" section in KDE system settings.

Package Management

Update the system

pacman -Syuu

apt update && apt upgarde

dnf update

Update Flatpaks

flatpak update

Update snaps

snap refresh

Install a package

pacman -S name

apt install name

dnf install name

Remove a package

pacman -R name

apt remove name

dnf remove name

Rebuild GRUB Config

The GRUB config is usually located at /boot/grub/grub.cfg or /boot/grub.cfg

grub-mkconfig -o <file name>