Arch Linux Commands & Helpful Content - LeandroTheDev/arch_linux GitHub Wiki
Locations
sddm theme location
- /usr/share/sddm/themes/
xfce theme location
- ~/.local/share/themes
Theme - ~/.icons
Icons & Cursor
GRUB config file location
- /etc/default/grub
Commands
Uncompress
- tar -xvf
Packages Installations
- makepkg -sic
View Folder Size
- du -ah --max-depth 1
View disk available
- df -h
View public ip from your router
- curl ipinfo.io/ip
Pacman
Show a list of installed packages with that name
- pacman -Qs
Show a list of non official packages
- sudo pacman -Qm
Reinstall all the packages of main repository
- sudo pacman -Qqn
Remove all usseless dependencies
- sudo pacman -Rns $(pacman -Qdtq)
Clear Cache
- sudo pacman -Scc
Force remove package, without crying about dependencies
- sudo pacman -Rdds
Remove package with configs and dependencies
- sudo pacman -Rns
Force Installing
sudo pacman -S package --overwrite \*
Updating system
- sudo pacman -Syu --ignore=nvidia,nvidia-utils,lib32-nvidia-utils
Remove password requirement for "su" in whell group users
- sudo vim /etc/pam.d/su
-
Remove comment:
auth sufficient pam_wheel.so trust use_uid
Permissions
-
Permissions to all in currently directory
- chmod +x+r+w -R *
-
Default file permissioning for specific group
- setfacl -d -m g:group_name:rw /path/to/directory
-
Change ownership
- chown username:usergroup /path/to/directory
Change grub order
- sudo vim /etc/default/grub
- GRUB_DEFAULT="2"
Update-grub
Show Windows in grub
- sudo vim /etc/default/grub
- #GRUB_DISABLE_OS_PROBER=false
- update-grub
Formating a disk
List the disks
- fdisk -l
Select the disk you want to format
- fdisk /dev/sd?
- o, n, default...
Save
- w
Add signature to linux read
- sudo mkfs.ext4 /dev/sd??
Give Permissions
- sudo chown -R person /run/media/person/diskID
- sudo chgrp -R person /run/media/person/diskID
Disable Lapto/Notebooks Lid Close Suspension
- sudo vim /etc/systemd/logind.conf
Remove # and change to "ignore"
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
- systemctl restart systemd-logind
Script to Auto Get IP
#!/bin/sh
public_ip=""
while true
do
current_ip="$(curl -s ipinfo.io/ip)"
if [ "$public_ip" != "$current_ip"]; then
public_ip=$current_ip
curl -k "https://www.provider/?ip=$public_ip
fi
sleep 3600
done
User variables on login (the good way)
- mkdir -p ~/.local/bin
- vim ~/.local/bin/env.sh
#!/bin/sh
username="$(whoami)"
systemctl --user set-environment \
PATH="/path/to/software/bin:$PATH" \
CHROME_EXECUTABLE=/usr/bin/chromium
...
- chmod +x ~/.local/bin/env.sh
- mkdir -p ~/.config/systemd/user
- vim ~/.config/systemd/user/env.service
[Unit]
Description=User environment variables
Before=default.target
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c 'source ~/.local/bin/env.sh'
RemainAfterExit=yes
[Install]
WantedBy=default.target
- Start now:
systemctl --user daemon-reexec&&systemctl --user daemon-reload - systemctl --user enable --now env.service