Category: Bash / Terminal / Scripts

GNU Linux bash – optimizing basics – the ll alias to ll

ok an alias is simply an appreviation (ll) of a longer command (ls -lah –color) defined in one of those files: user@Debian8:~$ bash -l; # simulates a login 1. hello from /etc/bash.bashrc 2. hello from /etc/profile 7. hello from ~/.bash_profile […]

GNU Linux bash – notebook laptop test battery runtime script

how long (many hours) will this notebook-laptop battery last? some sensors/softwares report/calculate things like this… 5days on one charge is a very very optimistic estimate for most intel or amd based notebooks (even for RISC/ARM based notebooks-laptops that would be […]


this might sound trivial, but there are multiple approaches: # for (theoretically every) Debian, but not every Debian based system: cat /etc/debian_version 11.3 # for Debian 10 and prior hostnamectl|grep Op Operating System: Debian GNU/Linux 10 (buster) # for Debian […]

GNU Linux bash – get root partition

hostnamectl|grep Op Operating System: Debian GNU/Linux 10 (buster) # and also on lsb_release -d Description: Debian GNU/Linux 11 (bullseye) su – root df -m | grep ” \+/$” | awk ‘{print $1;}’ # because of a bug, runnig it as […]

GNU Linux bash – script to generate thumbnails

# requirements su – root apt update # has the convert command apt install imagemagick vim /scripts/ #!/bin/bash THUMBS_FOLDER=/path/to/images/thumbnails for file in /path/to/images/* do # next line checks the mime-type of the file IMAGE_TYPE=`file –mime-type -b “$file” | awk -F’/’ […]


hostnamectl; # tested on Icon name: computer-desktop Chassis: desktop Operating System: Debian GNU/Linux 10 (buster) Kernel: Linux 4.19.0-8-amd64 Architecture: x86-64 su – root; # become root apt update apt install rfkill rfkill list all 0: phy0: Wireless LAN Soft blocked: […]

gnu linux bash – ssh login as different user

situation: one is userA but wants to ssh login to server with ipv4: via userB (dedicated user for that server/task). so what one does is: make sure one can login as userB than as userA: userA: ssh -v -i […]