helpful linux commands

Post Reply
zemerdon
Site Admin
Posts: 310
Joined: Mon Jan 23, 2023 8:13 pm

helpful linux commands

Post by zemerdon »

watch with pipe

Code: Select all

watch -n10 'df -ah | grep "p4"'
list connected usb transfer rate

Code: Select all

lspci -t
change linux startup/shutdown text size

Code: Select all

 run: sudo dpkg-reconfigure console-setup, and follow the prompts. It was pretty self-explanatory.
apt upgrade latest package/use backports

Code: Select all

root@server:/home/zemerdon# apt-get -t bullseye-backports install zfs-dkms zfsutils-linux zfs-zed
find current gpu driver version

Code: Select all

root@server:/home/zemerdon# glxinfo | grep string
list installed linux packages installed one liner

Code: Select all

apt list --installed | cut -f1 -d / | tr "\n" " "
apt list --installed | awk -F/ '{s=$1" "s} END{print s}' 
apt list --installed | sed -E ':a;N;$!ba;s/\n/ /g;s/\/[^]]+\]//g'
ubuntu server installation ipv4 setup

Code: Select all

Subnet: 192.168.1.0/24
Address: 192.168.1.101
Gateway: 192.168.1.1
Name servers: 8.8.8.8
debian find services that failed on startup

Code: Select all

journalctl -b0 _PID=1 | grep Failed
problematic startup services. boot service times.

Code: Select all

 system-analyze blame
prevent automatic service restarts, you can also mask the service

Code: Select all

systemctl mask upower.service
df returns /efi not found and/or takes a long time to respond. Disable system-gpt-auto-generator.
"systemd-gpt-auto-generator — Generator for automatically discovering and mounting root, /home/, /srv/, /var/ and /var/tmp/ partitions, as well as discovering and enabling swap partitions, based on GPT partition type GUIDs".

edit /etc/default/grub

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="systemd.gpt_auto=0"
#GRUB_CMDLINE_LINUX="modprobe.blacklist=nvme"
mount disk .img.
if img is disk use losetup then mount. if img is partition use mount only.

Code: Select all

losetup --find --show disk.img
 mount /dev/loop1p1 /mnt/part1
extract ALL rars in all directories into their respective directories. run from the top level.

Code: Select all

rar x -r -ad *.rar
monitor a current process output with tail

Code: Select all

cd /proc/<pid here>/fd && tail -f *
motherboard information

Code: Select all

dmidecode -t 2
RAM information

Code: Select all

sudo dmidecode --type 17
apt install specific package version

Code: Select all

sudo apt-get install gparted=0.16.1-1
what video driver is in use

Code: Select all

lspci -nnk | egrep -i --color 'vga|3d|2d' -A3 | grep 'in use'
QEMU list booted VMs

Code: Select all

virsh -c qemu:///system list
find pdf password

Code: Select all

./pdfcrack ../document.pdf
remove pdf security

Code: Select all

pdftk input.pdf input_pw YOURPASSWORD output output.pdf
zemerdon
Site Admin
Posts: 310
Joined: Mon Jan 23, 2023 8:13 pm

Re: helpful linux commands

Post by zemerdon »

quickly change apt mirror

Code: Select all

sudo sed -i 's/ftp.au.debian.org/mirror.aarnet.edu.au/g' /etc/apt/sources.list
Post Reply