Arch
➕Package install
sudo pacman -S package_name
✔️ System update
sudo pacman -Syu
✖️ Package Remove
sudo pacman -R package_name
✖️ Package Remove Without dependencies
sudo pacman -Rdd package_name
📋 List installed packages sorted by size
pacman -Qi | awk -F: '$1~/^Name / { name=$2 } $1~/^Installed Size / { gsub(/ /, ""); size=$2; print size, name }' | sort -hr | column -t | less
Debian
➕Package install
sudo apt install app_name
✖️ App remove
sudo apt remove app_name
✔️ System update
sudo apt update && sudo apt upgrade -y
Redhat
➕Package install
sudo dnf install app_name
✖️ Package remove
sudo dnf remove app_name
✔️ System update
sudo dnf upgrade --refresh
App .rpmfiles install, remove
sudo rpm -i/r app_name.rpm
Arch and not only utils
‼️ Annotation
Remember abut man
command and --help
flag to read how to use commands
man ls
ls --help
💽 HDD poweroff
udisksctl power-off -b /dev/sdx
🌐 Network manager cli, wifi connect
nmcli device wifi connect “SSID” password "xxxxx"
📁 Copy, move, remove files or folders
cp, mv, rm filename, rm -r foldername
🖊️ Changename
mv filename newfilename
📋 Ip adress check
ip a
💿 Create qcow2 image
qemu-img create -f qcow2 disk1.img 10G
android-file-tranfer
)
aft-mtp-mount /mnt
💿 Mount iso file as compact disc
mount -o loop /path/to/image.iso /media/mountpoint
🗝️ Show windows product key
sudo strings /sys/firmware/acpi/tables/MSDM
🏁 Show startup times by system.d
systemd-analyze
🔓 tar.zst extract
tar -I zstd -xf
🔑 Password secured zip
zip -er outputfolder.zip Folder-to-zip/
📁 Show folder/file size
du -sh foldername
📀 Make bootable Linux drive ( dont use partition )
dd bs=4M if=path/to/input.iso of=/dev/sdX conv=fdatasync status=progress
📀 Make bootable windows by sudo woeusb -v --device /windows/iso/path /dev/sdx
❌Format partition to FAT32 file system.
mkfs.fat -F 32 /dev/sdXY
❌Format partition to exFAT file system. I recommend exfat file system for disk used between different operating systems.
mkfs.exfat /dev/sdXY
❌Format partition to NTFS file system (add -f flag to fast format).
mkfs.ntfs /dev/sdXY
❌Format partition to ext4 file system.
mkfs.ext4 /dev/sdXY
🧠 Display free and used memory.
free -m
Create file with certain size.
head -c "" /dev/zero >
example:
head -c 10MB /dev/zero > file10mb
📖 Display systemd last boot journal.
journalctl -b
💿 Create iso from cd/dvd
Check sector size and sector.
isosize -x /dev/sr0
Create iso
dd if=/dev/sr0 of=discmage.iso bs=sector_size count=sector_count status=progress
🔗 Create symbolic link
ln -s /path/to/folder /path/to/place/symbolic/link
📂 Display path of current directory
pwd
✖️ ❕"Hardreset" format drives to zero
dd if=/dev/zero of=/dev/sdX bs=16M status=progress
📱 Mount iPhone
Download ifuse
from AUR to be able to mount iPhone, also should work for iPads
- Start usbmuxd.service
- Pair iPhone (Device must be unlocked)
- Mount iPhone
- Umount iPhone
systemctl start usbmuxd.service
idevicepair pair
You will need to confirm access on iPhone
ifuse -o allow_other /mountpoint
Probably you have to change config in /etc/fuse.conf
and uncomment #user_allow_other
fusermount -u /mountpoint
🎧 Bluetooth audio device
Needed packages pulseaudio-bluetooth
and bluez-utils
.
- Start bluetooth service
- Open bluetooth utility
- Scan for devices
- Pair device
- Connect to paired device
- For automatically connect
systemctl start bluetooth.service
bluetoothctl
Bluetooth utility:
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on
[bluetooth]# pair XX:XX:XX:XX:XX (MAC)
[bluetooth]# connect XX:XX:XX:XX:XX
[bluetooth]# trust XX:XX:XX:XX:XX
[bluetooth]# scan off
[bluetooth]# exit
To switch PulseAudio switch on connected module you need to add this line to /etc/pulse/default.pa
load-module module-switch-on-connect
Also if you want, enable auto power on bluetooth edit /etc/bluetooth/main.conf
AutoEnable=true
🌐 Share internet over Ethernet
Install dnsmasq
and nm-connection-editor
Run
nm-connection-editor
from terminal.Add a new ethernet connection.
Give it some sensible name. For example "Shared Internet".
Go to "IPv4 Settings".
For "Method:" select "Shared to other computers".
Save
And thats all folks.
🌐 Share internet over Wi-Fi
Install dnsmasq
and nm-connection-editor
Create new wireless network
Create password
Choose either Hotspot or Ad-hoc as Wi-Fi mode
🧡 Git
New
git init
git add
git commit -m "commit message"
git remote add origin git@github.com:username/new_repo.git
git push origin master
Exist repo
git add .
git commit -m "commit message"
git push origin master
Rename last no pushed commit
git commit --amend -m "commit message"
Rename last pushed commit
git commit --amend -m "commit message"
git push --force origin master
Manipulate the UEFI Boot Manager
List EFI bootorders
efibootmgr
Remove EFI bootorder
efibootmgr -b XXXX -B
Set EFI bootorder
efibootmgr -o XXXX