Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:linux-tutorials:quicktutorials [2024/12/25 14:07] – created Zyzonixlinux:linux-tutorials:quicktutorials [2024/12/25 14:11] (current) Zyzonix
Line 1: Line 1:
 ===== Quicktutorials ===== ===== Quicktutorials =====
 +
 +==== Get OS information ====
 +Get OS information from ''/etc/os-release''.
 +
 +Example: Debian:
 +<code bash>
 +PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
 +NAME="Debian GNU/Linux"
 +VERSION_ID="11"
 +VERSION="11 (bullseye)"
 +VERSION_CODENAME=bullseye
 +ID=debian
 +HOME_URL="https://www.debian.org/"
 +SUPPORT_URL="https://www.debian.org/support"
 +BUG_REPORT_URL="https://bugs.debian.org/"
 +</code>
 +
 +Import this to a bash script via:
 +
 +The var ''ID'' is then ''debian'':
 +<code bash>
 +if [ -f /etc/os-release ]; then
 +  . /etc/os-release
 +  ID=$ID
 +fi
 +</code>
 +
 +Or use ''neofetch'':
 +<code bash>neofetch</code>
 +//installed via: ''apt install neofetch''//
 +
 +Sourced from: [[https://unix.stackexchange.com/questions/6345/how-can-i-get-distribution-name-and-version-number-in-a-simple-shell-script|stackexchange.org]]
 +------
 +==== View CPU information ====
 +
 +To view information about the CPU use
 +<code bash>cat /proc/cpuinfo</code>
 +------
 +
 +==== Create .img on Linux CLI ====
 +It's quite simple to create an image of a disk, for example an SD card, therefore use the following command:
 +<code bash>dd if=/path/to/device of=image.img</code>
 +
 +The ''/path/to/device'' can be found out with:
 +<code bash>lsblk</code>
 +For example it can be ''/dev/sda''.
 +Remind that using this method will include also empty parts. An image of a 32 GB SD card will later have a size of 32 GB although for example 16 GB are unused.
 +
 +-----
 +
 +==== Show WiFi password via CLI ====
 +Thereby that a system is required to save WiFi passwords in clear, it can also show those passwords to you.
 +By running the following command (NetworkManager required), the SSID, password and a QR-code of the current connected WiFi will be displayed in your CLI:
 +<code bash>nmcli device wifi show-password</code>
 +
 +
  • linux/linux-tutorials/quicktutorials.1735132020.txt.gz
  • Last modified: 2024/12/25 14:07
  • by Zyzonix