Shell Utills and not only
Arch
-`
.o+`
`ooo/
`+oooo:
`+oooooo:
-+oooooo+:
`/:-:++oooo+:
`/++++/+++++++:
`/++++++++++++++:
`/+++ooooooooooooo/`
./ooosssso++osssssso+`
.oossssso-````/ossssss+`
-osssssso. :ssssssso.
:osssssss/ osssso+++.
/ossssssss/ +ssssooo/-
`/ossssso+/:- -:/+osssso+-
`+sso+:-` `.-/+oso:
`++:. `-/+/
.` `
βPackage install
$ sudo pacman -S package_name
βοΈ System update
βοΈ Remove package
$ sudo pacman -R 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
_,met$$$$$gg.
,g$$$$$$$$$$$$$$$P.
,g$$P"" """Y$$.".
,$$P' `$$$.
',$$P ,ggs. `$$b:
`d$$' ,$P"' . $$$
$$P d$' , $$P
$$: $$. - ,d$$'
$$; Y$b._ _,d$P'
Y$$. `.`"Y$$$$P"'
`$$b "-.__
`Y$$b
`Y$$.
`$$b.
`Y$$b.
`"Y$b._
`""""
βApp install
$ sudo apt install app_name
βοΈ App remove
$ sudo apt remove app_name
βοΈ System update
$ sudo apt update && sudo apt upgrade -y
Redhat
.MMM..:MMMMMMM
MMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMM.
MMMMMMMMMMMMMMMMMMMMMM
,MMMMMMMMMMMMMMMMMMMMMM:
MMMMMMMMMMMMMMMMMMMMMMMM
.MMMM' MMMMMMMMMMMMMMMMMMMMMM
MMMMMM \`MMMMMMMMMMMMMMMMMMMM.
MMMMMMMM MMMMMMMMMMMMMMMMMM .
MMMMMMMMM. \`MMMMMMMMMMMMM' MM.
MMMMMMMMMMM. MMMM
\`MMMMMMMMMMMMM. ,MMMMM.
\`MMMMMMMMMMMMMMMMM. ,MMMMMMMM.
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
\`MMMMMMMMMMMMMMMMMMMMMMMM:
\`\`MMMMMMMMMMMMMMMMM'
βApp install
$ sudo yum/dnf install app_name
βοΈ App remove
$ sudo yum/dnf remove app_name
βοΈ System update
App .rpmfiles install, remove
$ sudo rpm -i/r app_name.rpm
Arch and not only things
π½ HDD poweroff
$ udisksctl power-off -b /dev/sdx
π Network manager cli, wifi connect
$ nmcli device wifi connect βSSIDβ password "xxxxx"
π Copy, move, remove files/folders
$ cp, mv, rm filename
$ rm -r folder
ποΈ Change name
$ mv filename newfilename
π Ip adress check
πΏ Create qcow2 image
$ qemu-img create -f qcow2 disk1.img 10G
π± Mount android phone as storage (download android-file-tranfer)
πΏ Mount iso like dvd or cd disk
$ 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
π tar.zst extract
π Password secured zip
$ zip -er outputfolder.zip Folder-to-zip/
π Show folder/file size
π Make bootable GNU/Linux drive ( dont use partition )
$ dd bs=4M if=path/to/input.iso of=/dev/sdX conv=fdatasync status=progress
π Make bootable windows or GNU/Linux drive, also gui available
gui
$ sudo woeusb -v --device /windows/iso/path /dev/sdx
βFormat partition to FAT32 file system
$ mkfs.fat -F 32 /dev/sdXY
βFormat partition to NTFS file system (add -f flag to fast format)
βFormat partition to ext4 file system
π§ Display free and used memory
π Display systemd last boot journal
πΏ Create iso from cd/dvd
Check sector size and sector
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
βοΈ β"Hardreset" format drives to zero
$ dd if=/dev/zero of=/dev/sdX bs=16M status=progress
π± Mount iPhone
Download
ifuse
from AUR
Start usbmuxd.service
$ systemctl start usbmuxd.service
Pair iPhone (Device must be unlocked)
Mount iPhone
$ ifuse -o allow_other /mountpoint
Probably you have to change config in /etc/fuse.conf and uncomment #user_allow_other
Umount iPhone
$ fusermount -u /mountpoint
π§ Bluetooth Headphones
Needed packages pulseaudio-bluetooth and bluez-utils.
Start bluetooth service
$ systemctl start bluetooth.service
Open bluetooth utility
Bluetooth utility
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
Scan for devices
Pair device
[bluetooth]# pair XX:XX:XX:XX:XX (MAC)
Connect to paired device
[bluetooth]# connect XX:XX:XX:XX:XX
For automatically connect
[bluetooth]# trust XX:XX:XX:XX:XX
[bluetooth]# scan off
[bluetooth]# exit
To switch PulseAudio switch on connected module you need to add this lines 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
π 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".
- For "Method:" select "Shared to other computers".
π Share internet over Wi-Fi
Install dnsmasq and nm-connection-editor
- Create new wireless network
- Choose either Hotspot or Ad-hoc as Wi-Fi mode
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