Jump to content

Useful Commands: Difference between revisions

From SameTeem
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
== How Much Space is in use? ==
== Kill program from command line ==




df -h
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.


== Install a package ==
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  <u>336G</u>  99G  <u>78%</u> /'''
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 ===
<tabber>
|-|Arch Based =
pacman -Syuu
If you have paru installed you can update all your AUR packages with:
paru
|-|Debian Based =
apt update && apt upgarde
|-|Red Hat Based =
dnf update
</tabber>
=== Update Flatpaks ===
flatpak update
=== Update snaps ===
snap refresh
=== Install a package ===
<tabber>
<tabber>
|-|Arch Based=
|-|Arch Based=
Line 15: Line 72:
dnf install name
dnf install name
</tabber>
</tabber>
=== Remove a package ===
<tabber>
|-|Arch Based =
pacman  -R name
|-|Debian Based =
apt remove name
|-|Red Hat Based =
dnf remove name
</tabber>
== Rebuild GRUB Config ==
The GRUB config is usually located at /boot/grub/grub.cfg or /boot/grub.cfg
grub-mkconfig -o <file name>

Latest revision as of 00:19, 9 August 2026

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

If you have paru installed you can update all your AUR packages with:

paru

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>