Bash-Abfragen für alles Mögliche: Unterschied zwischen den Versionen
DG5MGJ (Diskussion | Beiträge) (→CPU) |
DG5MGJ (Diskussion | Beiträge) |
||
| (62 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
==Ein kurzer Griff zum Terminal und schon hat man die Info== | ==Ein kurzer Griff zum Terminal und schon hat man die Info== | ||
| − | Hier liste ich so einige Abfragen auf, welche sicher interessant sind. | + | '''Hier liste ich so einige Abfragen auf, welche sicher interessant für Dich sind.''' |
| + | |||
| + | '''Bitte beachten''': Wenn eine Befehlszeile mit "$" beginnt, dann ist dies unter einem normalen User ausführbar,<br> | ||
| + | beginnt die Befehlszeile jedoch mit "#", so sind Superuserrechte erforderlich. <br> | ||
| + | Entweder man wechselt mit <code>$ '''sudo su -'''</code> in den Superuser root oder man stellt ein <code>$ '''sudo'''</code> voran, womit nach Angabe des eigenen Passwortes der Befehl unter SuperUser-Hoheit ausgeführt wird - sofern man dafür berechtigt ist. Siehe auch: https://wiki.ubuntuusers.de/sudo/ | ||
| + | |||
| + | Die ersten Zeichen wie "$" oder "#" bitte nicht mitkopieren, diese stellen den Prompt der Shell dar und sind zu obiger Information hier angegeben. | ||
| + | |||
| + | Eine gesammelte List der Hard- und Software erhält man mit folgender Abfrage | ||
| + | $ '''inxi -Fxxxrz --usb;lspci -nnk;lsusb -tv;xinput --list;dkms status;cat /proc/cmdline;mokutil --sb-state''' | ||
| + | |||
| + | ==Hardware Gehäuse und Bios== | ||
| + | Das Tool <code>dmidecode</code> kann die Tabelle im SMBIOS auswerten und anzeigen. Hier einige Beispiele für Abfragen<br> | ||
| + | Installation falls noch nicht vorhanden mit: <code>$ sudo apt-get install dmidecode</code> | ||
| + | {| class="wikitable" | ||
| + | |- | ||
| + | ! Befehl !! Beschreibung der ausgegebenen Informationen | ||
| + | |- | ||
| + | | $ sudo dmidecode || Alle verfügbaren Informationen ausgeben | ||
| + | |- | ||
| + | | $ sudo dmidecode -s system-manufacturer || Hersteller des Systems | ||
| + | |- | ||
| + | | $ sudo dmidecode -s system-product-name || Produktname des Systems | ||
| + | |- | ||
| + | | $ sudo dmidecode -s system-version || Modell Nr. des Systems | ||
| + | |- | ||
| + | | $ sudo dmidecode -s bios-version || Verwendete BIOS-Version | ||
| + | |- | ||
| + | | $ sudo dmidecode -s baseboard-manufacturer || Hersteller des Mainboards | ||
| + | |- | ||
| + | | $ sudo dmidecode -s baseboard-product-name || Produktname des Mainboards | ||
| + | |- | ||
| + | | $ sudo dmidecode -s baseboard-version || Versionsnummer des Mainboards | ||
| + | |- | ||
| + | | $ sudo dmidecode -t 1 || SMBIOS-Tabelle 1 ausgeben (System Information) | ||
| + | |} | ||
| + | Welche Tabellen es gibt, kann man mit folgendem Einzeiler anzeigen: | ||
| + | $ '''sudo dmidecode | grep -A1 "^Handle" | tr "\n" "\t" | sed -e 's/--\t/\n/g'''' | ||
| + | Handle 0x0000, DMI type 0, 24 bytes BIOS Information | ||
| + | Handle 0x0001, DMI type 1, 27 bytes System Information | ||
| + | Handle 0x0002, DMI type 2, 16 bytes Base Board Information | ||
| + | Handle 0x0003, DMI type 3, 23 bytes Chassis Information | ||
| + | Handle 0x0004, DMI type 4, 42 bytes Processor Information | ||
| + | Handle 0x0005, DMI type 5, 20 bytes Memory Controller Information | ||
| + | Handle 0x0006, DMI type 6, 12 bytes Memory Module Information | ||
| + | Handle 0x0007, DMI type 6, 12 bytes Memory Module Information | ||
| + | Handle 0x0008, DMI type 7, 19 bytes Cache Information | ||
| + | Handle 0x0009, DMI type 7, 19 bytes Cache Information | ||
| + | Handle 0x000A, DMI type 7, 19 bytes Cache Information | ||
| + | Handle 0x000B, DMI type 7, 19 bytes Cache Information | ||
| + | Handle 0x000C, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x000D, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x000E, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x000F, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0010, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0011, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0012, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0013, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0014, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0015, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0016, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0017, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0018, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x0019, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x001A, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x001B, DMI type 8, 9 bytes Port Connector Information | ||
| + | Handle 0x001C, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x001D, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x001E, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x001F, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x0020, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x0021, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x0022, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x0023, DMI type 9, 17 bytes System Slot Information | ||
| + | Handle 0x0024, DMI type 11, 5 bytes OEM Strings | ||
| + | Handle 0x0025, DMI type 12, 5 bytes System Configuration Options | ||
| + | Handle 0x0026, DMI type 13, 22 bytes BIOS Language Information | ||
| + | Handle 0x0027, DMI type 15, 29 bytes System Event Log | ||
| + | Handle 0x0028, DMI type 16, 23 bytes Physical Memory Array | ||
| + | Handle 0x0029, DMI type 17, 34 bytes Memory Device | ||
| + | Handle 0x002A, DMI type 17, 34 bytes Memory Device | ||
| + | Handle 0x002B, DMI type 18, 23 bytes 32-bit Memory Error Information | ||
| + | Handle 0x002C, DMI type 18, 23 bytes 32-bit Memory Error Information | ||
| + | Handle 0x002D, DMI type 19, 31 bytes Memory Array Mapped Address | ||
| + | Handle 0x002E, DMI type 20, 35 bytes Memory Device Mapped Address | ||
| + | Handle 0x002F, DMI type 21, 7 bytes Built-in Pointing Device | ||
| + | Handle 0x0030, DMI type 22, 26 bytes Portable Battery | ||
| + | Handle 0x0031, DMI type 26, 22 bytes Voltage Probe | ||
| + | Handle 0x0032, DMI type 27, 15 bytes Cooling Device | ||
| + | Handle 0x0033, DMI type 32, 20 bytes System Boot Information | ||
| + | Handle 0x0034, DMI type 39, 22 bytes System Power Supply | ||
| + | Handle 0x0035, DMI type 40, 18 bytes Additional Information 1 | ||
| + | Handle 0x0036, DMI type 41, 11 bytes Onboard Device | ||
| + | Handle 0x0037, DMI type 128, 8 bytes OEM-specific Type | ||
| + | Handle 0x0038, DMI type 129, 8 bytes OEM-specific Type | ||
| + | Handle 0x0039, DMI type 130, 20 bytes OEM-specific Type | ||
| + | Handle 0x003A, DMI type 136, 6 bytes OEM-specific Type | ||
| + | Handle 0x003B, DMI type 127, 4 bytes End Of Table | ||
| + | ''Achtung: Diese Ausgaben sind für jedes System unterschiedlich!'' | ||
| + | |||
| + | |||
| + | Ausgabe der ersten 7 Tabelleninhalte (0-6) mit folgendem Einzeiler | ||
| + | $ '''for Cnt in {0..6}; do sudo dmidecode -t $Cnt; done''' | ||
| + | Mit den Parametern in den geschweiften Klammern kann man den Nummernkreis einstellen | ||
| + | |||
| + | ==Zustand der Batterie== | ||
| + | Dies ist natürlich nur bei Laptops oder Tabletts interessant | ||
| + | $ inxi -B | ||
| + | Battery: | ||
| + | ID-1: BAT0 charge: 35.4 Wh (100.0%) condition: 35.4/62.2 Wh (57.0%) | ||
| + | In diesem Beispiel hat der 9 Jahre alte Akku statt der anfänglichen Kapazität von 62Wh nur noch 35Wh (57%)<br> | ||
| + | Das Alter kann man am Akku selbst auf einem Aufdruck ablesen. | ||
==Memory== | ==Memory== | ||
| − | Welche Memoryausstattung hat mein Rechner und welches Swap wird benutzt? | + | '''Welche Memoryausstattung hat mein Rechner und welches Swap wird benutzt?''' |
| − | $ free -h | + | $ '''free -h''' |
gesamt benutzt frei gemns. Puffer/Cache verfügbar | gesamt benutzt frei gemns. Puffer/Cache verfügbar | ||
Speicher: 15Gi 2,3Gi 9,9Gi 509Mi 3,3Gi 12Gi | Speicher: 15Gi 2,3Gi 9,9Gi 509Mi 3,3Gi 12Gi | ||
| Zeile 10: | Zeile 121: | ||
Der Parameter -h lässt die Werte in lesbarer Form (--human) anzeigen | Der Parameter -h lässt die Werte in lesbarer Form (--human) anzeigen | ||
| − | $ swapon -s | + | |
| + | $ '''swapon -s''' | ||
Filename Type Size Used Priority | Filename Type Size Used Priority | ||
/dev/sda1 partition 25165820 0 -2 | /dev/sda1 partition 25165820 0 -2 | ||
Der Parameter -s (--summary) zeigt diese Auswertung an | Der Parameter -s (--summary) zeigt diese Auswertung an | ||
| + | |||
| + | Informationen in tabelarischer Form bekommt man mit: | ||
| + | $ '''less /proc/meminfo''' | ||
| + | Damit kann man auch gezielt Werte mit <code>grep</code> herausgreifen. | ||
==CPU== | ==CPU== | ||
'''Was läuft denn für eine CPU und wie viele Kerne und Threds hat diese''' | '''Was läuft denn für eine CPU und wie viele Kerne und Threds hat diese''' | ||
| − | $ sed -n '/model name/p' /proc/cpuinfo | sort -u | + | $ '''sed -n '/model name/p' /proc/cpuinfo | sort -u''' |
model name : Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz | model name : Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz | ||
Es werden alle "Modellnamen aus der Liste geholt und dann mit sort vereinzelt. | Es werden alle "Modellnamen aus der Liste geholt und dann mit sort vereinzelt. | ||
| + | |||
Genauere Informationen zum ersten Prozessorkern | Genauere Informationen zum ersten Prozessorkern | ||
| − | $ sed -n '1,/^$/p' /proc/cpuinfo | + | $ '''sed -n '1,/^$/p' /proc/cpuinfo''' |
processor : 0 | processor : 0 | ||
vendor_id : GenuineIntel | vendor_id : GenuineIntel | ||
| Zeile 53: | Zeile 170: | ||
==Festplatte und SSD== | ==Festplatte und SSD== | ||
| − | Welche Festplatten sind vorhanden und welche Partitionen sind darauf | + | '''Welche Festplatten sind vorhanden und welche Partitionen sind darauf''' |
| − | $ lsblk | + | $ '''lsblk''' |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | ||
sda 8:0 0 953,9G 0 disk | sda 8:0 0 953,9G 0 disk | ||
| Zeile 66: | Zeile 183: | ||
└─sdb1 8:17 0 1,8T 0 part /data | └─sdb1 8:17 0 1,8T 0 part /data | ||
sr0 11:0 1 1024M 0 rom | sr0 11:0 1 1024M 0 rom | ||
| + | |||
Welchen Label und UUID haben diese Partitionen | Welchen Label und UUID haben diese Partitionen | ||
| − | $ blkid | + | $ '''blkid''' |
/dev/sdb1: LABEL="daten" UUID="6eb24451-0ec5-4a0c-bb57-5ea515cf01a4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5144b5ca-8634-4dc0-846a-cb291a09e41a" | /dev/sdb1: LABEL="daten" UUID="6eb24451-0ec5-4a0c-bb57-5ea515cf01a4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5144b5ca-8634-4dc0-846a-cb291a09e41a" | ||
/dev/sda4: LABEL="home-alt" UUID="53286760-5dcc-41c5-b29e-de5576491656" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home-alt" PARTUUID="13ef0d09-126c-4d1c-af8a-9133b96689f4" | /dev/sda4: LABEL="home-alt" UUID="53286760-5dcc-41c5-b29e-de5576491656" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home-alt" PARTUUID="13ef0d09-126c-4d1c-af8a-9133b96689f4" | ||
| Zeile 76: | Zeile 194: | ||
/dev/sda1: UUID="bf1d7fde-24ca-4e27-bf94-4261e85dd6b2" TYPE="swap" PARTUUID="781d2d5d-a8b7-4dd8-930c-f593ebfd401f" | /dev/sda1: UUID="bf1d7fde-24ca-4e27-bf94-4261e85dd6b2" TYPE="swap" PARTUUID="781d2d5d-a8b7-4dd8-930c-f593ebfd401f" | ||
/dev/sda6: UUID="23090bf2-b747-4048-9b03-544ddbab9eb2" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="251a8385-451c-4915-be64-42b2777a35ba" | /dev/sda6: UUID="23090bf2-b747-4048-9b03-544ddbab9eb2" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="251a8385-451c-4915-be64-42b2777a35ba" | ||
| + | Dafür kann man sich auche einen Alias bauen, der eine tabelarische Übersicht erzeugt: | ||
| + | $ alias UUID='lsblk -o "KNAME,PARTLABEL,UUID,FSTYPE,SIZE,FSUSED,MOUNTPOINT"|sed -e "/^.\{7\} \{32\}/ s/ /_/g;/_\{32\}/ s/^/\n/"' | ||
| + | Dies kann man auch in die Datei <code>.bash_aliases</code> einbauen und es steht immer zur Verfügung. | ||
| + | |||
| + | Eine weitere alternative/sortierte Anzeigeart der Daten: | ||
| + | $ '''blkid | sort | sed -e 's/$/\n/;s/ /\n\t/g'''' | ||
| + | |||
| + | Welche Typ von Festplatte ist verbaut und wie sind die Daten organisiert | ||
| + | $ sudo fdisk -l -u /dev/sdb | ||
| + | Festplatte /dev/sdb: 1,82 TiB, 2000398934016 Bytes, 3907029168 Sektoren | ||
| + | Festplattenmodell: ST2000LX001-1RG1 | ||
| + | Einheiten: Sektoren von 1 * 512 = 512 Bytes | ||
| + | Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes | ||
| + | E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes | ||
| + | Festplattenbezeichnungstyp: gpt | ||
| + | Festplattenbezeichner: 51C572DD-2585-4665-B097-9A83540278C1 | ||
| + | |||
| + | Gerät Anfang Ende Sektoren Größe Typ | ||
| + | /dev/sdb1 2048 3907028991 3907026944 1,8T Linux-Dateisystem | ||
| + | |||
| + | und weitere Informationen zur Hardware | ||
| + | |||
| + | $ sudo smartctl -i -d scsi /dev/sdb | ||
| + | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-112-generic] (local build) | ||
| + | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
| + | |||
| + | User Capacity: 2.000.398.934.016 bytes [2,00 TB] | ||
| + | Logical block size: 512 bytes | ||
| + | Physical block size: 4096 bytes | ||
| + | LU is fully provisioned | ||
| + | Rotation Rate: 5400 rpm | ||
| + | Form Factor: 2.5 inches | ||
| + | Logical Unit id: 0x5000c500a955e4e0 | ||
| + | Serial number: WDZ4FEWZ | ||
| + | Device type: disk | ||
| + | Local Time is: Tue Jun 11 17:05:40 2024 CEST | ||
| + | SMART support is: Unavailable - device lacks SMART capability. | ||
| + | |||
| + | Hier noch einmal die gezielte Abfrage einer Partition mit Formatierung | ||
| + | $ blkid /dev/sdd1 | sed -e 's/$/\n/;s/ /\n\t/g' | ||
| + | /dev/sdd1: | ||
| + | LABEL="TI7data20240725" | ||
| + | UUID="a43678cd-6134-4799-9e89-2af71653febe" | ||
| + | BLOCK_SIZE="4096" | ||
| + | TYPE="ext4" | ||
| + | PARTLABEL="TI7data20240725" | ||
| + | PARTUUID="44b52abb-66cc-45af-bfb1-7fc8cfc3bfff" | ||
| + | |||
| + | '''Wie geht es denn einer bestimmten Festplatte''' | ||
| + | $ '''sudo smartctl -A /dev/sdb''' | ||
| + | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-112-generic] (local build) | ||
| + | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
| + | |||
| + | <nowiki>=== START OF READ SMART DATA SECTION ===</nowiki> | ||
| + | SMART Attributes Data Structure revision number: 10 | ||
| + | Vendor Specific SMART Attributes with Thresholds: | ||
| + | ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE | ||
| + | 1 Raw_Read_Error_Rate 0x000f 079 064 006 Pre-fail Always - 72944751 | ||
| + | 3 Spin_Up_Time 0x0003 099 099 000 Pre-fail Always - 0 | ||
| + | 4 Start_Stop_Count 0x0032 077 077 020 Old_age Always - 23958 | ||
| + | 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 2 | ||
| + | 7 Seek_Error_Rate 0x000f 083 060 045 Pre-fail Always - 4483255039 | ||
| + | 9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 26663 (227 39 0) | ||
| + | 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 | ||
| + | 12 Power_Cycle_Count 0x0032 092 092 020 Old_age Always - 8660 | ||
| + | 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 | ||
| + | 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 | ||
| + | 188 Command_Timeout 0x0032 100 099 000 Old_age Always - 13 | ||
| + | 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 | ||
| + | 190 Airflow_Temperature_Cel 0x0022 071 037 040 Old_age Always In_the_past 29 (0 130 31 28 0) | ||
| + | 191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 45 | ||
| + | 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 75 | ||
| + | 193 Load_Cycle_Count 0x0032 087 087 000 Old_age Always - 26975 | ||
| + | 194 Temperature_Celsius 0x0022 029 063 000 Old_age Always - 29 (0 15 0 0 0) | ||
| + | 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 | ||
| + | 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 | ||
| + | 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 | ||
| + | 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 19670h+56m+08.684s | ||
| + | 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 56645851929 | ||
| + | 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 72661152743 | ||
| + | 254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0 | ||
| + | |||
| + | ===Belegung externer USB-Festplatten ermitteln und anzeigen=== | ||
| + | Mit einem kleinen Script und einem Alias kann man sich den Freibereich und die Belegung der externen Festplatte anzeigen lassen. | ||
| + | <nowiki>#!/bin/bash</nowiki> | ||
| + | <nowiki>## ***************************************************************************************** ##</nowiki> | ||
| + | <nowiki>## ******** Anzeigen der gemounteten externen Terrabyte-Disks nach Label sortiert ******** ##</nowiki> | ||
| + | <nowiki>## ***************************************************************************************** ##</nowiki> | ||
| + | <nowiki>## 2025-02-03 Rudi Korrektur der Feldlänge bei UTF-8-Umlauten in der Ausgabe mit printf</nowiki> | ||
| + | <nowiki>## ----------------------------------------------------------------------------------------- ##</nowiki> | ||
| + | <nowiki>##* Es werden keine GB-Usb-Sticks angezeigt. Nur Disks mit "TB" in der df Info unter /media/</nowiki> | ||
| + | <nowiki>## ----------------------------------------------------------------------------------------- ##</nowiki> | ||
| + | |||
| + | <nowiki>This_Name="show_disks"</nowiki> | ||
| + | <nowiki>Temp_File="/tmp/${This_Name}_${LOGNAME}_$$.tmp"</nowiki> | ||
| + | |||
| + | <nowiki>df -hl 2>/dev/null | sed -n '1p;/media/p' |\</nowiki> | ||
| + | <nowiki>sed -e 's/^\(.\{14\}\)\([^%]\+% \)\(.*\)/\3 \2 \3/;s/^\/.*\/\(.*%\)/\1/;1s/^/./;1s/ //' |\</nowiki> | ||
| + | <nowiki>sed -e '1 s/^.\{17\}/Partition-Label~ /;s/^\.//;1s/Eingehängt auf/Einhängepunkt/' > ${Temp_File}</nowiki> | ||
| + | <nowiki>HeadLine="`sed -n '1p' ${Temp_File}`"</nowiki> | ||
| + | <nowiki>sed -e '1d' ${Temp_File} | sort | sed -e "1s#^#${HeadLine}\n#" |\</nowiki> | ||
| + | <nowiki>column -t | sed -e '1s/~//;s/ \//\//'</nowiki> | ||
| + | |||
| + | <nowiki>DskCnt="`sed -e '1d' ${Temp_File} | wc -l`"</nowiki> | ||
| + | <nowiki>echo -e "\t Anzahl eingehängter externer Partitionen: ${DskCnt}"</nowiki> | ||
| + | |||
| + | <nowiki>if [ ${DskCnt} -gt 0 ]</nowiki> | ||
| + | <nowiki>then</nowiki> | ||
| + | <nowiki>for Idx in 2 3 4</nowiki> | ||
| + | <nowiki>do </nowiki> | ||
| + | <nowiki># Field_Name="`sed -n '1p' ${Temp_File} | awk '{ print $'$Idx' }'|sed -e 's/ü/ue/g;s/Ü/Ue/g;s/ä/ae/g;s/Ä/Ae/g;s/ö/oe/g;s/Ö/Oe/g;s/ß/ss/g'`"</nowiki> | ||
| + | <nowiki>Field_Name="`sed -n '1p' ${Temp_File} | awk '{ print $'$Idx' }'`"</nowiki> | ||
| + | <nowiki>Field_NamX=$(echo ${Field_Name} | tr -d "[A-z] .-")</nowiki> | ||
| + | <nowiki>FieldValue="`sed -e '1d' ${Temp_File} | awk '{ print $'$Idx' }'|tr "\n" "+"|sed -e 's/,/./g;s/G//g;s/T/*1024/g;s/M/*0.001/g;s/+$//'`"</nowiki> | ||
| + | <nowiki>FieldValGB="`echo "${FieldValue}" | bc`"</nowiki> | ||
| + | <nowiki>FieldValTB="`echo "scale=3;${FieldValGB}/1024" | bc | sed -e 's/^\./0,/;s/\./,/'`"</nowiki> | ||
| + | <nowiki>printf "\t %-$((8+${#Field_NamX}))s: %9s TB\n" ${Field_Name} ${FieldValTB}</nowiki> | ||
| + | <nowiki>done</nowiki> | ||
| + | <nowiki>else echo -e "\t Keine TB-Disks zum Auswerten angeschlossen"</nowiki> | ||
| + | <nowiki>fi</nowiki> | ||
| + | <nowiki>rm ${Temp_File}</nowiki> | ||
| + | |||
| + | <nowiki>## ***************************************************************************************** ##</nowiki> | ||
| + | Und folgender Alias erleichtert den Aufruf '''Disks="/home/johndoe/Videos/Script/show_Media-Disks.sh"''' | ||
| + | |||
| + | ===Inhalt auf Festplatten=== | ||
| + | '''Welche Pfade sind denn auf meiner Festplatte (begrenzte Anzeige)''' | ||
| + | $ '''tree -dlL 2 /home''' | ||
| + | /home | ||
| + | ├── Backup | ||
| + | │ ├── TuxedoI7_2023-02-21 | ||
| + | │ └── TuxedoI7_2023-03-07 | ||
| + | ├── lost+found [error opening dir] | ||
| + | ├── johndoe | ||
| + | │ ├── Bilder | ||
| + | │ ├── Dokumente | ||
| + | │ ├── Downloads | ||
| + | │ ├── EXPORTS | ||
| + | │ ├── logfiles -> /data/logfiles | ||
| + | │ ├── Musik | ||
| + | │ ├── Öffentlich | ||
| + | │ ├── PlayOnLinux's virtual drives -> /home/johndoe/.PlayOnLinux//wineprefix/ | ||
| + | │ ├── Schreibtisch | ||
| + | │ ├── Videos | ||
| + | │ ├── Vorlagen | ||
| + | │ └── Warpinator | ||
| + | └── timeshift | ||
| + | ├── snapshots | ||
| + | ├── snapshots-boot | ||
| + | ├── snapshots-daily | ||
| + | ├── snapshots-hourly | ||
| + | ├── snapshots-monthly | ||
| + | ├── snapshots-ondemand | ||
| + | └── snapshots-weekly | ||
| + | |||
| + | 25 directories | ||
| + | Angaben zu den benutzten Optionen (-dlL) | ||
| + | * Mit der Option "d" werden nur Directorys angezeigt | ||
| + | * Die Option "l" zeigt die Verlinkung an und folgt dieser | ||
| + | * Mit dem Parameter "L" und der Zahlenangabe wird die Anzeigentiefe gewählt<br>hier 2 Anzeigeebenen. | ||
| + | |||
| + | ==Prozesse suchen und anzeigen== | ||
| + | '''Auslastung des Rechners mit Filtermöglichkeiten''' | ||
| + | '''$ htop''' | ||
| + | ... zeigt wie <code>top</code> die vorhandenen Prozesse an, bietet aber bessere Auswahlmöglichkeiten<br> | ||
| + | installieren mit <code>$ sudo apt-get install htop</code> | ||
| + | |||
| + | |||
| + | '''aktive Jobs aus der crontab anzeigen''' | ||
| + | $ '''crontab -l | grep -v '^#'''' | ||
| + | Bei dieser Anzeige werden alle Kommentare ausgeblendet | ||
| + | |||
| + | |||
| + | '''Prozesse des crond anzeigen - laufende crontab-Jobs''' | ||
| + | $ pstree -pa `pgrep cron` | ||
| + | cron,950 -f -P | ||
| + | Aktuell kein laufender Cron-Job. Ansonsten wird der komplette Prozessbaum angezeigt. | ||
| + | |||
| + | ==Passwortstatus eines Users== | ||
| + | Mit dem Befehl <code>change</code> kann man die Passwortlaufzeit und die Nutzungsdauer von Usern abfragen und auch ändern. | ||
| + | $ '''sudo chage --list johndoe''' | ||
| + | <nowiki>[sudo] Passwort für johndoe: ********</nowiki> | ||
| + | <nowiki>Letzte Passwortänderung : Feb 22, 2024</nowiki> | ||
| + | <nowiki>Passwort läuft ab : nie</nowiki> | ||
| + | <nowiki>Passwort inaktiv : nie</nowiki> | ||
| + | <nowiki>Benutzerzugang läuft ab : nie</nowiki> | ||
| + | <nowiki>Minimale Anzahl der Tage zwischen Passwortänderungen : 0</nowiki> | ||
| + | <nowiki>Maximale Anzahl der Tage zwischen Passwortänderungen : 99999</nowiki> | ||
| + | <nowiki>Anzahl Tage, an denen vor Passwortablauf gewarnt wird : 7</nowiki> | ||
| + | Hierzu weitere Informationen: | ||
| + | <nowiki>Aufruf: chage [Optionen] BENUTZERZUGANG</nowiki> | ||
| + | |||
| + | <nowiki>Optionen:</nowiki> | ||
| + | <nowiki>-d, --lastday LETZTER_TAG Tag der letzten Passwortänderung auf LETZTER_TAG setzen</nowiki> | ||
| + | <nowiki>-E, --expiredate ABL_DATUM Ablaufdatum des Benutzerzugangs auf ABL_DATUM setzen</nowiki> | ||
| + | <nowiki>-h, --help Diese Hilfe anzeigen, sonst nichts</nowiki> | ||
| + | <nowiki>-i, --iso8601 JJJJ-MM-TT beim Datumdruck benutzen</nowiki> | ||
| + | <nowiki>-I, --inactive INAKTIV Passwort nach Ablauf von INAKTIV deaktivieren</nowiki> | ||
| + | <nowiki>-l, --list Informationen zu Ablaufdaten usw. anzeigen</nowiki> | ||
| + | <nowiki>-m, --mindays MIN_TAGE Minimale Anzahl der Tage vor Passwortänderung auf MIN_TAGE setzen</nowiki> | ||
| + | <nowiki>-M, --maxdays MAX_DASY setze maximale Anzahl an Tagen vor Kennwort ändere auf MAX_DAYS</nowiki> | ||
| + | <nowiki>-R, --root CHROOT_VERZ Verzeichnis für chroot</nowiki> | ||
| + | <nowiki>-W, --warndays WARN_TAGE Anzahl der Tage für Ablaufwarnung auf WARN_TAGE setzen</nowiki> | ||
| + | |||
| + | ==Netzwerkabfragen== | ||
| + | Welche IP-Interfaces hat mein Rechner und welche Adressen sind eingestellt: | ||
| + | '''$ ip addr''' | ||
| + | <nowiki>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</nowiki> | ||
| + | <nowiki>link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</nowiki> | ||
| + | <nowiki>inet 127.0.0.1/8 scope host lo</nowiki> | ||
| + | <nowiki>valid_lft forever preferred_lft forever</nowiki> | ||
| + | <nowiki>inet6 ::1/128 scope host </nowiki> | ||
| + | <nowiki>valid_lft forever preferred_lft forever</nowiki> | ||
| + | <nowiki>2: enp5s0f2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000</nowiki> | ||
| + | <nowiki>link/ether 80:fa:5b:0d:8c:56 brd ff:ff:ff:ff:ff:ff</nowiki> | ||
| + | <nowiki>inet 192.168.2.102/24 brd 192.168.2.255 scope global dynamic noprefixroute enp5s0f2</nowiki> | ||
| + | <nowiki>valid_lft 1795246sec preferred_lft 1795246sec</nowiki> | ||
| + | <nowiki>inet6 2001:a61:2a22:e701:763b:b666:9f7f:26a0/128 scope global deprecated dynamic noprefixroute </nowiki> | ||
| + | <nowiki>valid_lft 2168sec preferred_lft 0sec</nowiki> | ||
| + | <nowiki>inet6 fd00::176c:76c5:292a:82ad/64 scope global dynamic noprefixroute </nowiki> | ||
| + | <nowiki>valid_lft 7152sec preferred_lft 3552sec</nowiki> | ||
| + | <nowiki>inet6 2001:a61:2a22:e701:2bfd:78c7:eb4c:eb27/64 scope global dynamic noprefixroute </nowiki> | ||
| + | <nowiki>valid_lft 5638sec preferred_lft 2038sec</nowiki> | ||
| + | <nowiki>inet6 fe80::763b:b666:9f7f:26a0/64 scope link noprefixroute </nowiki> | ||
| + | <nowiki>valid_lft forever preferred_lft forever</nowiki> | ||
| + | <nowiki>3: wlp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000</nowiki> | ||
| + | <nowiki>link/ether d8:fc:93:a9:86:68 brd ff:ff:ff:ff:ff:ff</nowiki> | ||
| + | Informationen über einen Internet-Hostnamen | ||
| + | $ '''host rudi-hoepp.de''' | ||
| + | rudi-hoepp.de has address 85.13.121.227 | ||
| + | rudi-hoepp.de mail is handled by 10 w0098765.kasserver.com. | ||
| + | Informationen über eine Internet-Adresse | ||
| + | $ '''host 85.13.121.227''' | ||
| + | 227.121.13.85.in-addr.arpa domain name pointer dd34500.kasserver.com. | ||
| + | Das funktioniert auch mit IPv6-Adressen und diese werden dannn aufgedröselt angezeigt | ||
| + | $ '''host 2001:a61:2a22:e701:2bfd:78c7:eb4c:eb27''' | ||
| + | 7.2.b.e.c.4.b.e.7.c.8.7.d.f.b.2.1.0.7.e.2.2.a.2.1.6.a.0.1.0.0.2.ip6.arpa domain name pointer Taenzer7. | ||
| + | 7.2.b.e.c.4.b.e.7.c.8.7.d.f.b.2.1.0.7.e.2.2.a.2.1.6.a.0.1.0.0.2.ip6.arpa domain name pointer Taenzer7.local. | ||
| + | |||
| + | ==Sensoren im Rechner== | ||
| + | Dafür ist normalerweise das Paket lm-sensors installiert und dann kann man folgendes Abfragen: | ||
| + | $ '''sudo sensors''' | ||
| + | <nowiki>BAT0-acpi-0</nowiki> | ||
| + | <nowiki>Adapter: ACPI interface</nowiki> | ||
| + | <nowiki>in0: 12.79 V </nowiki> | ||
| + | <nowiki>curr1: 2.65 A </nowiki> | ||
| + | |||
| + | <nowiki>coretemp-isa-0000</nowiki> | ||
| + | <nowiki>Adapter: ISA adapter</nowiki> | ||
| + | <nowiki>Package id 0: +53.0°C (high = +84.0°C, crit = +100.0°C)</nowiki> | ||
| + | <nowiki>Core 0: +53.0°C (high = +84.0°C, crit = +100.0°C)</nowiki> | ||
| + | <nowiki>Core 1: +50.0°C (high = +84.0°C, crit = +100.0°C)</nowiki> | ||
| + | <nowiki>Core 2: +50.0°C (high = +84.0°C, crit = +100.0°C)</nowiki> | ||
| + | <nowiki>Core 3: +48.0°C (high = +84.0°C, crit = +100.0°C)</nowiki> | ||
| + | |||
| + | <nowiki>acpitz-acpi-0</nowiki> | ||
| + | <nowiki>Adapter: ACPI interface</nowiki> | ||
| + | <nowiki>temp1: +14.0°C (crit = +120.0°C)</nowiki> | ||
| + | |||
| + | ==Wie lange läuft der Rechner schon== | ||
| + | Wie lange ein Rechner läuft oder wann dieser gebootet wurde geben diese beiden Abfragen preis | ||
| + | $ '''uptime''' | ||
| + | 17:38:04 up 25 days, 23:57, 1 user, load average: 0,33, 0,15, 0,06 | ||
| + | |||
| + | $ '''who -b''' | ||
| + | Systemstart 2025-09-11 07:15 | ||
| + | Wobei diese Abfrage nur auf Systemen mit Realtimeclock vernünftige Ergebnisse liefern | ||
| + | $ '''who -b | ||
| + | ''' Systemstart 1970-01-01 01:00 | ||
| + | Hier liefert uptime -s das richtige Ergebnis: | ||
| + | $ '''uptime -s''' | ||
| + | 2024-05-16 17:40:47 | ||
| + | ---- | ||
| + | ==Speed-Test des DSL-Anschlusses testen== | ||
| + | Im Internet gibt es viele Browserbasierende Geschwindigkeitstest für den DSL-Anschluss. Hier ist ein CLI-Speed-Test, welcher dafür geeignet ist, zyklische Tests im Batch-Betrieb auszuführen. Dabei werden die Ergebnisse als Text angegeben und können so weiterverarbeitet werden. Natürlich sollten zeitgleich keine anderen Internetaktivitäten ausgeführt werden, um das Ergebnis nicht zu verfälschen. | ||
| + | |||
| + | Der Speedtest ist im Repository vorhanden und kann darüber auch einfach installiert werden: | ||
| + | $ '''sudo apt install speedtest-cli''' | ||
| + | Anschließen kann man diesen einfach aufrufen: | ||
| + | $ '''speedtest''' | ||
| + | Retrieving speedtest.net configuration... | ||
| + | Testing from M-net (62.216.202.9)... | ||
| + | Retrieving speedtest.net server list... | ||
| + | Selecting best server based on ping... | ||
| + | Hosted by QNECTA (Girona) [962.94 km]: 1800000.0 ms | ||
| + | Testing download speed................................................................................ | ||
| + | Download: 53.94 Mbit/s | ||
| + | Testing upload speed...................................................................................................... | ||
| + | Upload: 9.71 Mbit/s | ||
| + | Mit einem grep-Filter kann man sich nur die Ergebnisse ausgeben lassen: | ||
| + | $ '''speedtest | egrep -i "Download:|Upload:"''' | ||
| + | '''Download:''' 11.58 Mbit/s | ||
| + | '''Upload:''' 4.13 Mbit/s | ||
| + | In diesem Fall stehen nur ca. 12 Mbit/s zur Verfügung, da an anderer Stelle Downloads laufen. Somit kann man auch die restlich verfügbare Bandbreite überprüfen. | ||
| + | ---- | ||
| + | |||
| + | ==Leere Dateien finden und anzeigen== | ||
| + | Manchmal ist es ja gewollt, dass nur eine leere Datei angelegt wird. Aber manchmal kommt es bei Programmabläufen zu Fehlern und es entstehen leere Dateien. Um diese in einem Verzeichnisbaum zu suchen, zu finden und aufzulisten kann man <code>find</code> gut gebrauchen. | ||
| + | |||
| + | $ '''find -L Videos/Movieguides -type f -empty -ls''' | ||
| + | |||
| + | Damit sucht man recursive im Verzeichnis nach Dateien des Typs "File" und überprüf auf leeren Inhalt. Alle leeren Dateien werden wie mit <code>ls -l</code> angezeigt. Die Option <code>-L</code> folgt auch Verlinkungen, falls der Pfad auf eine weitere Partition umgeleitet wurde.<br> | ||
| + | Weitere Möglichkeiten erschließen sich daraus: | ||
| + | * Zählen der leeren Dateien: | ||
| + | $ '''find -L Videos/Movieguides -type f -empty | wc -l''' | ||
| + | * löschen der leeren Dateien | ||
| + | $ '''find -L Videos/Movieguides -type f -empty -exec rm -v {} \;''' | ||
| + | |||
| + | Eine ausführliche Beschreibung ist hier zu finden: https://wiki.ubuntuusers.de/find/ | ||
| + | |||
| + | ==Links ins Internet== | ||
| + | '''Advanced Bash-Scripting Guide''' | ||
| + | An in-depth exploration of the art of shell scripting | ||
| + | * https://tldp.org/LDP/abs/html/ | ||
| + | |||
| + | '''The Linux Documentation Page''' | ||
| + | * https://tldp.org/ | ||
| + | |||
| + | ---- | ||
| − | + | ==Fortsetzung folgt== | |
Aktuelle Version vom 8. Oktober 2026, 08:57 Uhr
Inhaltsverzeichnis
- 1 Ein kurzer Griff zum Terminal und schon hat man die Info
- 2 Hardware Gehäuse und Bios
- 3 Zustand der Batterie
- 4 Memory
- 5 CPU
- 6 Festplatte und SSD
- 7 Prozesse suchen und anzeigen
- 8 Passwortstatus eines Users
- 9 Netzwerkabfragen
- 10 Sensoren im Rechner
- 11 Wie lange läuft der Rechner schon
- 12 Speed-Test des DSL-Anschlusses testen
- 13 Leere Dateien finden und anzeigen
- 14 Links ins Internet
- 15 Fortsetzung folgt
Ein kurzer Griff zum Terminal und schon hat man die Info
Hier liste ich so einige Abfragen auf, welche sicher interessant für Dich sind.
Bitte beachten: Wenn eine Befehlszeile mit "$" beginnt, dann ist dies unter einem normalen User ausführbar,
beginnt die Befehlszeile jedoch mit "#", so sind Superuserrechte erforderlich.
Entweder man wechselt mit $ sudo su - in den Superuser root oder man stellt ein $ sudo voran, womit nach Angabe des eigenen Passwortes der Befehl unter SuperUser-Hoheit ausgeführt wird - sofern man dafür berechtigt ist. Siehe auch: https://wiki.ubuntuusers.de/sudo/
Die ersten Zeichen wie "$" oder "#" bitte nicht mitkopieren, diese stellen den Prompt der Shell dar und sind zu obiger Information hier angegeben.
Eine gesammelte List der Hard- und Software erhält man mit folgender Abfrage
$ inxi -Fxxxrz --usb;lspci -nnk;lsusb -tv;xinput --list;dkms status;cat /proc/cmdline;mokutil --sb-state
Hardware Gehäuse und Bios
Das Tool dmidecode kann die Tabelle im SMBIOS auswerten und anzeigen. Hier einige Beispiele für Abfragen
Installation falls noch nicht vorhanden mit: $ sudo apt-get install dmidecode
| Befehl | Beschreibung der ausgegebenen Informationen |
|---|---|
| $ sudo dmidecode | Alle verfügbaren Informationen ausgeben |
| $ sudo dmidecode -s system-manufacturer | Hersteller des Systems |
| $ sudo dmidecode -s system-product-name | Produktname des Systems |
| $ sudo dmidecode -s system-version | Modell Nr. des Systems |
| $ sudo dmidecode -s bios-version | Verwendete BIOS-Version |
| $ sudo dmidecode -s baseboard-manufacturer | Hersteller des Mainboards |
| $ sudo dmidecode -s baseboard-product-name | Produktname des Mainboards |
| $ sudo dmidecode -s baseboard-version | Versionsnummer des Mainboards |
| $ sudo dmidecode -t 1 | SMBIOS-Tabelle 1 ausgeben (System Information) |
Welche Tabellen es gibt, kann man mit folgendem Einzeiler anzeigen:
$ sudo dmidecode | grep -A1 "^Handle" | tr "\n" "\t" | sed -e 's/--\t/\n/g' Handle 0x0000, DMI type 0, 24 bytes BIOS Information Handle 0x0001, DMI type 1, 27 bytes System Information Handle 0x0002, DMI type 2, 16 bytes Base Board Information Handle 0x0003, DMI type 3, 23 bytes Chassis Information Handle 0x0004, DMI type 4, 42 bytes Processor Information Handle 0x0005, DMI type 5, 20 bytes Memory Controller Information Handle 0x0006, DMI type 6, 12 bytes Memory Module Information Handle 0x0007, DMI type 6, 12 bytes Memory Module Information Handle 0x0008, DMI type 7, 19 bytes Cache Information Handle 0x0009, DMI type 7, 19 bytes Cache Information Handle 0x000A, DMI type 7, 19 bytes Cache Information Handle 0x000B, DMI type 7, 19 bytes Cache Information Handle 0x000C, DMI type 8, 9 bytes Port Connector Information Handle 0x000D, DMI type 8, 9 bytes Port Connector Information Handle 0x000E, DMI type 8, 9 bytes Port Connector Information Handle 0x000F, DMI type 8, 9 bytes Port Connector Information Handle 0x0010, DMI type 8, 9 bytes Port Connector Information Handle 0x0011, DMI type 8, 9 bytes Port Connector Information Handle 0x0012, DMI type 8, 9 bytes Port Connector Information Handle 0x0013, DMI type 8, 9 bytes Port Connector Information Handle 0x0014, DMI type 8, 9 bytes Port Connector Information Handle 0x0015, DMI type 8, 9 bytes Port Connector Information Handle 0x0016, DMI type 8, 9 bytes Port Connector Information Handle 0x0017, DMI type 8, 9 bytes Port Connector Information Handle 0x0018, DMI type 8, 9 bytes Port Connector Information Handle 0x0019, DMI type 8, 9 bytes Port Connector Information Handle 0x001A, DMI type 8, 9 bytes Port Connector Information Handle 0x001B, DMI type 8, 9 bytes Port Connector Information Handle 0x001C, DMI type 9, 17 bytes System Slot Information Handle 0x001D, DMI type 9, 17 bytes System Slot Information Handle 0x001E, DMI type 9, 17 bytes System Slot Information Handle 0x001F, DMI type 9, 17 bytes System Slot Information Handle 0x0020, DMI type 9, 17 bytes System Slot Information Handle 0x0021, DMI type 9, 17 bytes System Slot Information Handle 0x0022, DMI type 9, 17 bytes System Slot Information Handle 0x0023, DMI type 9, 17 bytes System Slot Information Handle 0x0024, DMI type 11, 5 bytes OEM Strings Handle 0x0025, DMI type 12, 5 bytes System Configuration Options Handle 0x0026, DMI type 13, 22 bytes BIOS Language Information Handle 0x0027, DMI type 15, 29 bytes System Event Log Handle 0x0028, DMI type 16, 23 bytes Physical Memory Array Handle 0x0029, DMI type 17, 34 bytes Memory Device Handle 0x002A, DMI type 17, 34 bytes Memory Device Handle 0x002B, DMI type 18, 23 bytes 32-bit Memory Error Information Handle 0x002C, DMI type 18, 23 bytes 32-bit Memory Error Information Handle 0x002D, DMI type 19, 31 bytes Memory Array Mapped Address Handle 0x002E, DMI type 20, 35 bytes Memory Device Mapped Address Handle 0x002F, DMI type 21, 7 bytes Built-in Pointing Device Handle 0x0030, DMI type 22, 26 bytes Portable Battery Handle 0x0031, DMI type 26, 22 bytes Voltage Probe Handle 0x0032, DMI type 27, 15 bytes Cooling Device Handle 0x0033, DMI type 32, 20 bytes System Boot Information Handle 0x0034, DMI type 39, 22 bytes System Power Supply Handle 0x0035, DMI type 40, 18 bytes Additional Information 1 Handle 0x0036, DMI type 41, 11 bytes Onboard Device Handle 0x0037, DMI type 128, 8 bytes OEM-specific Type Handle 0x0038, DMI type 129, 8 bytes OEM-specific Type Handle 0x0039, DMI type 130, 20 bytes OEM-specific Type Handle 0x003A, DMI type 136, 6 bytes OEM-specific Type Handle 0x003B, DMI type 127, 4 bytes End Of Table
Achtung: Diese Ausgaben sind für jedes System unterschiedlich!
Ausgabe der ersten 7 Tabelleninhalte (0-6) mit folgendem Einzeiler
$ for Cnt in {0..6}; do sudo dmidecode -t $Cnt; done
Mit den Parametern in den geschweiften Klammern kann man den Nummernkreis einstellen
Zustand der Batterie
Dies ist natürlich nur bei Laptops oder Tabletts interessant
$ inxi -B Battery: ID-1: BAT0 charge: 35.4 Wh (100.0%) condition: 35.4/62.2 Wh (57.0%)
In diesem Beispiel hat der 9 Jahre alte Akku statt der anfänglichen Kapazität von 62Wh nur noch 35Wh (57%)
Das Alter kann man am Akku selbst auf einem Aufdruck ablesen.
Memory
Welche Memoryausstattung hat mein Rechner und welches Swap wird benutzt?
$ free -h
gesamt benutzt frei gemns. Puffer/Cache verfügbar
Speicher: 15Gi 2,3Gi 9,9Gi 509Mi 3,3Gi 12Gi
Auslager: 23Gi 0B 23Gi
Der Parameter -h lässt die Werte in lesbarer Form (--human) anzeigen
$ swapon -s Filename Type Size Used Priority /dev/sda1 partition 25165820 0 -2
Der Parameter -s (--summary) zeigt diese Auswertung an
Informationen in tabelarischer Form bekommt man mit:
$ less /proc/meminfo
Damit kann man auch gezielt Werte mit grep herausgreifen.
CPU
Was läuft denn für eine CPU und wie viele Kerne und Threds hat diese
$ sed -n '/model name/p' /proc/cpuinfo | sort -u model name : Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
Es werden alle "Modellnamen aus der Liste geholt und dann mit sort vereinzelt.
Genauere Informationen zum ersten Prozessorkern
$ sed -n '1,/^$/p' /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz stepping : 3 microcode : 0x28 cpu MHz : 800.000 cache size : 6144 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fm cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d vmx flags : vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown bogomips : 4988.44 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:
Alle Informationen zu allen Prozessorkernen bekommt man mit less /proc/cpuinfo
Festplatte und SSD
Welche Festplatten sind vorhanden und welche Partitionen sind darauf
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 953,9G 0 disk ├─sda1 8:1 0 24G 0 part [SWAP] ├─sda2 8:2 0 128M 0 part /boot/efi ├─sda3 8:3 0 52G 0 part ├─sda4 8:4 0 52G 0 part ├─sda5 8:5 0 128G 0 part / └─sda6 8:6 0 697,7G 0 part /home sdb 8:16 0 1,8T 0 disk └─sdb1 8:17 0 1,8T 0 part /data sr0 11:0 1 1024M 0 rom
Welchen Label und UUID haben diese Partitionen
$ blkid /dev/sdb1: LABEL="daten" UUID="6eb24451-0ec5-4a0c-bb57-5ea515cf01a4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5144b5ca-8634-4dc0-846a-cb291a09e41a" /dev/sda4: LABEL="home-alt" UUID="53286760-5dcc-41c5-b29e-de5576491656" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home-alt" PARTUUID="13ef0d09-126c-4d1c-af8a-9133b96689f4" /dev/sda2: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="2547-1779" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="ba4c278c-13a1-48b9-b801-0e81176a8c6e" /dev/sda5: UUID="78b49306-74c5-4e07-a19b-cc92bb153736" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="root" PARTUUID="548eccf0-7d6c-464a-988a-0b435eb1a26e" /dev/sda3: UUID="63e7caac-d7bc-447b-a6a0-ec7365524d9c" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="root-alt" PARTUUID="5cb81689-d726-4990-9fdd-51d777be9198" /dev/sda1: UUID="bf1d7fde-24ca-4e27-bf94-4261e85dd6b2" TYPE="swap" PARTUUID="781d2d5d-a8b7-4dd8-930c-f593ebfd401f" /dev/sda6: UUID="23090bf2-b747-4048-9b03-544ddbab9eb2" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="251a8385-451c-4915-be64-42b2777a35ba"
Dafür kann man sich auche einen Alias bauen, der eine tabelarische Übersicht erzeugt:
$ alias UUID='lsblk -o "KNAME,PARTLABEL,UUID,FSTYPE,SIZE,FSUSED,MOUNTPOINT"|sed -e "/^.\{7\} \{32\}/ s/ /_/g;/_\{32\}/ s/^/\n/"'
Dies kann man auch in die Datei .bash_aliases einbauen und es steht immer zur Verfügung.
Eine weitere alternative/sortierte Anzeigeart der Daten:
$ blkid | sort | sed -e 's/$/\n/;s/ /\n\t/g'
Welche Typ von Festplatte ist verbaut und wie sind die Daten organisiert
$ sudo fdisk -l -u /dev/sdb Festplatte /dev/sdb: 1,82 TiB, 2000398934016 Bytes, 3907029168 Sektoren Festplattenmodell: ST2000LX001-1RG1 Einheiten: Sektoren von 1 * 512 = 512 Bytes Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes Festplattenbezeichnungstyp: gpt Festplattenbezeichner: 51C572DD-2585-4665-B097-9A83540278C1 Gerät Anfang Ende Sektoren Größe Typ /dev/sdb1 2048 3907028991 3907026944 1,8T Linux-Dateisystem
und weitere Informationen zur Hardware
$ sudo smartctl -i -d scsi /dev/sdb smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-112-generic] (local build) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org User Capacity: 2.000.398.934.016 bytes [2,00 TB] Logical block size: 512 bytes Physical block size: 4096 bytes LU is fully provisioned Rotation Rate: 5400 rpm Form Factor: 2.5 inches Logical Unit id: 0x5000c500a955e4e0 Serial number: WDZ4FEWZ Device type: disk Local Time is: Tue Jun 11 17:05:40 2024 CEST SMART support is: Unavailable - device lacks SMART capability.
Hier noch einmal die gezielte Abfrage einer Partition mit Formatierung
$ blkid /dev/sdd1 | sed -e 's/$/\n/;s/ /\n\t/g'
/dev/sdd1:
LABEL="TI7data20240725"
UUID="a43678cd-6134-4799-9e89-2af71653febe"
BLOCK_SIZE="4096"
TYPE="ext4"
PARTLABEL="TI7data20240725"
PARTUUID="44b52abb-66cc-45af-bfb1-7fc8cfc3bfff"
Wie geht es denn einer bestimmten Festplatte
$ sudo smartctl -A /dev/sdb smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-112-generic] (local build) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 079 064 006 Pre-fail Always - 72944751 3 Spin_Up_Time 0x0003 099 099 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 077 077 020 Old_age Always - 23958 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 2 7 Seek_Error_Rate 0x000f 083 060 045 Pre-fail Always - 4483255039 9 Power_On_Hours 0x0032 070 070 000 Old_age Always - 26663 (227 39 0) 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 092 092 020 Old_age Always - 8660 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 188 Command_Timeout 0x0032 100 099 000 Old_age Always - 13 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 071 037 040 Old_age Always In_the_past 29 (0 130 31 28 0) 191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 45 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 75 193 Load_Cycle_Count 0x0032 087 087 000 Old_age Always - 26975 194 Temperature_Celsius 0x0022 029 063 000 Old_age Always - 29 (0 15 0 0 0) 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 19670h+56m+08.684s 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 56645851929 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 72661152743 254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
Belegung externer USB-Festplatten ermitteln und anzeigen
Mit einem kleinen Script und einem Alias kann man sich den Freibereich und die Belegung der externen Festplatte anzeigen lassen.
#!/bin/bash
## ***************************************************************************************** ##
## ******** Anzeigen der gemounteten externen Terrabyte-Disks nach Label sortiert ******** ##
## ***************************************************************************************** ##
## 2025-02-03 Rudi Korrektur der Feldlänge bei UTF-8-Umlauten in der Ausgabe mit printf
## ----------------------------------------------------------------------------------------- ##
##* Es werden keine GB-Usb-Sticks angezeigt. Nur Disks mit "TB" in der df Info unter /media/
## ----------------------------------------------------------------------------------------- ##
This_Name="show_disks"
Temp_File="/tmp/${This_Name}_${LOGNAME}_$$.tmp"
df -hl 2>/dev/null | sed -n '1p;/media/p' |\
sed -e 's/^\(.\{14\}\)\([^%]\+% \)\(.*\)/\3 \2 \3/;s/^\/.*\/\(.*%\)/\1/;1s/^/./;1s/ //' |\
sed -e '1 s/^.\{17\}/Partition-Label~ /;s/^\.//;1s/Eingehängt auf/Einhängepunkt/' > ${Temp_File}
HeadLine="`sed -n '1p' ${Temp_File}`"
sed -e '1d' ${Temp_File} | sort | sed -e "1s#^#${HeadLine}\n#" |\
column -t | sed -e '1s/~//;s/ \//\//'
DskCnt="`sed -e '1d' ${Temp_File} | wc -l`"
echo -e "\t Anzahl eingehängter externer Partitionen: ${DskCnt}"
if [ ${DskCnt} -gt 0 ]
then
for Idx in 2 3 4
do
# Field_Name="`sed -n '1p' ${Temp_File} | awk '{ print $'$Idx' }'|sed -e 's/ü/ue/g;s/Ü/Ue/g;s/ä/ae/g;s/Ä/Ae/g;s/ö/oe/g;s/Ö/Oe/g;s/ß/ss/g'`"
Field_Name="`sed -n '1p' ${Temp_File} | awk '{ print $'$Idx' }'`"
Field_NamX=$(echo ${Field_Name} | tr -d "[A-z] .-")
FieldValue="`sed -e '1d' ${Temp_File} | awk '{ print $'$Idx' }'|tr "\n" "+"|sed -e 's/,/./g;s/G//g;s/T/*1024/g;s/M/*0.001/g;s/+$//'`"
FieldValGB="`echo "${FieldValue}" | bc`"
FieldValTB="`echo "scale=3;${FieldValGB}/1024" | bc | sed -e 's/^\./0,/;s/\./,/'`"
printf "\t %-$((8+${#Field_NamX}))s: %9s TB\n" ${Field_Name} ${FieldValTB}
done
else echo -e "\t Keine TB-Disks zum Auswerten angeschlossen"
fi
rm ${Temp_File}
## ***************************************************************************************** ##
Und folgender Alias erleichtert den Aufruf Disks="/home/johndoe/Videos/Script/show_Media-Disks.sh"
Inhalt auf Festplatten
Welche Pfade sind denn auf meiner Festplatte (begrenzte Anzeige)
$ tree -dlL 2 /home
/home
├── Backup
│ ├── TuxedoI7_2023-02-21
│ └── TuxedoI7_2023-03-07
├── lost+found [error opening dir]
├── johndoe
│ ├── Bilder
│ ├── Dokumente
│ ├── Downloads
│ ├── EXPORTS
│ ├── logfiles -> /data/logfiles
│ ├── Musik
│ ├── Öffentlich
│ ├── PlayOnLinux's virtual drives -> /home/johndoe/.PlayOnLinux//wineprefix/
│ ├── Schreibtisch
│ ├── Videos
│ ├── Vorlagen
│ └── Warpinator
└── timeshift
├── snapshots
├── snapshots-boot
├── snapshots-daily
├── snapshots-hourly
├── snapshots-monthly
├── snapshots-ondemand
└── snapshots-weekly
25 directories
Angaben zu den benutzten Optionen (-dlL)
- Mit der Option "d" werden nur Directorys angezeigt
- Die Option "l" zeigt die Verlinkung an und folgt dieser
- Mit dem Parameter "L" und der Zahlenangabe wird die Anzeigentiefe gewählt
hier 2 Anzeigeebenen.
Prozesse suchen und anzeigen
Auslastung des Rechners mit Filtermöglichkeiten
$ htop
... zeigt wie top die vorhandenen Prozesse an, bietet aber bessere Auswahlmöglichkeiten
installieren mit $ sudo apt-get install htop
aktive Jobs aus der crontab anzeigen
$ crontab -l | grep -v '^#'
Bei dieser Anzeige werden alle Kommentare ausgeblendet
Prozesse des crond anzeigen - laufende crontab-Jobs
$ pstree -pa `pgrep cron` cron,950 -f -P
Aktuell kein laufender Cron-Job. Ansonsten wird der komplette Prozessbaum angezeigt.
Passwortstatus eines Users
Mit dem Befehl change kann man die Passwortlaufzeit und die Nutzungsdauer von Usern abfragen und auch ändern.
$ sudo chage --list johndoe [sudo] Passwort für johndoe: ******** Letzte Passwortänderung : Feb 22, 2024 Passwort läuft ab : nie Passwort inaktiv : nie Benutzerzugang läuft ab : nie Minimale Anzahl der Tage zwischen Passwortänderungen : 0 Maximale Anzahl der Tage zwischen Passwortänderungen : 99999 Anzahl Tage, an denen vor Passwortablauf gewarnt wird : 7
Hierzu weitere Informationen:
Aufruf: chage [Optionen] BENUTZERZUGANG Optionen: -d, --lastday LETZTER_TAG Tag der letzten Passwortänderung auf LETZTER_TAG setzen -E, --expiredate ABL_DATUM Ablaufdatum des Benutzerzugangs auf ABL_DATUM setzen -h, --help Diese Hilfe anzeigen, sonst nichts -i, --iso8601 JJJJ-MM-TT beim Datumdruck benutzen -I, --inactive INAKTIV Passwort nach Ablauf von INAKTIV deaktivieren -l, --list Informationen zu Ablaufdaten usw. anzeigen -m, --mindays MIN_TAGE Minimale Anzahl der Tage vor Passwortänderung auf MIN_TAGE setzen -M, --maxdays MAX_DASY setze maximale Anzahl an Tagen vor Kennwort ändere auf MAX_DAYS -R, --root CHROOT_VERZ Verzeichnis für chroot -W, --warndays WARN_TAGE Anzahl der Tage für Ablaufwarnung auf WARN_TAGE setzen
Netzwerkabfragen
Welche IP-Interfaces hat mein Rechner und welche Adressen sind eingestellt:
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp5s0f2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 80:fa:5b:0d:8c:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.102/24 brd 192.168.2.255 scope global dynamic noprefixroute enp5s0f2
valid_lft 1795246sec preferred_lft 1795246sec
inet6 2001:a61:2a22:e701:763b:b666:9f7f:26a0/128 scope global deprecated dynamic noprefixroute
valid_lft 2168sec preferred_lft 0sec
inet6 fd00::176c:76c5:292a:82ad/64 scope global dynamic noprefixroute
valid_lft 7152sec preferred_lft 3552sec
inet6 2001:a61:2a22:e701:2bfd:78c7:eb4c:eb27/64 scope global dynamic noprefixroute
valid_lft 5638sec preferred_lft 2038sec
inet6 fe80::763b:b666:9f7f:26a0/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether d8:fc:93:a9:86:68 brd ff:ff:ff:ff:ff:ff
Informationen über einen Internet-Hostnamen
$ host rudi-hoepp.de rudi-hoepp.de has address 85.13.121.227 rudi-hoepp.de mail is handled by 10 w0098765.kasserver.com.
Informationen über eine Internet-Adresse
$ host 85.13.121.227 227.121.13.85.in-addr.arpa domain name pointer dd34500.kasserver.com.
Das funktioniert auch mit IPv6-Adressen und diese werden dannn aufgedröselt angezeigt
$ host 2001:a61:2a22:e701:2bfd:78c7:eb4c:eb27 7.2.b.e.c.4.b.e.7.c.8.7.d.f.b.2.1.0.7.e.2.2.a.2.1.6.a.0.1.0.0.2.ip6.arpa domain name pointer Taenzer7. 7.2.b.e.c.4.b.e.7.c.8.7.d.f.b.2.1.0.7.e.2.2.a.2.1.6.a.0.1.0.0.2.ip6.arpa domain name pointer Taenzer7.local.
Sensoren im Rechner
Dafür ist normalerweise das Paket lm-sensors installiert und dann kann man folgendes Abfragen:
$ sudo sensors BAT0-acpi-0 Adapter: ACPI interface in0: 12.79 V curr1: 2.65 A coretemp-isa-0000 Adapter: ISA adapter Package id 0: +53.0°C (high = +84.0°C, crit = +100.0°C) Core 0: +53.0°C (high = +84.0°C, crit = +100.0°C) Core 1: +50.0°C (high = +84.0°C, crit = +100.0°C) Core 2: +50.0°C (high = +84.0°C, crit = +100.0°C) Core 3: +48.0°C (high = +84.0°C, crit = +100.0°C) acpitz-acpi-0 Adapter: ACPI interface temp1: +14.0°C (crit = +120.0°C)
Wie lange läuft der Rechner schon
Wie lange ein Rechner läuft oder wann dieser gebootet wurde geben diese beiden Abfragen preis
$ uptime 17:38:04 up 25 days, 23:57, 1 user, load average: 0,33, 0,15, 0,06
$ who -b
Systemstart 2025-09-11 07:15
Wobei diese Abfrage nur auf Systemen mit Realtimeclock vernünftige Ergebnisse liefern
$ who -b
Systemstart 1970-01-01 01:00 Hier liefert uptime -s das richtige Ergebnis:
$ uptime -s 2024-05-16 17:40:47
Speed-Test des DSL-Anschlusses testen
Im Internet gibt es viele Browserbasierende Geschwindigkeitstest für den DSL-Anschluss. Hier ist ein CLI-Speed-Test, welcher dafür geeignet ist, zyklische Tests im Batch-Betrieb auszuführen. Dabei werden die Ergebnisse als Text angegeben und können so weiterverarbeitet werden. Natürlich sollten zeitgleich keine anderen Internetaktivitäten ausgeführt werden, um das Ergebnis nicht zu verfälschen.
Der Speedtest ist im Repository vorhanden und kann darüber auch einfach installiert werden:
$ sudo apt install speedtest-cli
Anschließen kann man diesen einfach aufrufen:
$ speedtest Retrieving speedtest.net configuration... Testing from M-net (62.216.202.9)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by QNECTA (Girona) [962.94 km]: 1800000.0 ms Testing download speed................................................................................ Download: 53.94 Mbit/s Testing upload speed...................................................................................................... Upload: 9.71 Mbit/s
Mit einem grep-Filter kann man sich nur die Ergebnisse ausgeben lassen:
$ speedtest | egrep -i "Download:|Upload:" Download: 11.58 Mbit/s Upload: 4.13 Mbit/s
In diesem Fall stehen nur ca. 12 Mbit/s zur Verfügung, da an anderer Stelle Downloads laufen. Somit kann man auch die restlich verfügbare Bandbreite überprüfen.
Leere Dateien finden und anzeigen
Manchmal ist es ja gewollt, dass nur eine leere Datei angelegt wird. Aber manchmal kommt es bei Programmabläufen zu Fehlern und es entstehen leere Dateien. Um diese in einem Verzeichnisbaum zu suchen, zu finden und aufzulisten kann man find gut gebrauchen.
$ find -L Videos/Movieguides -type f -empty -ls
Damit sucht man recursive im Verzeichnis nach Dateien des Typs "File" und überprüf auf leeren Inhalt. Alle leeren Dateien werden wie mit ls -l angezeigt. Die Option -L folgt auch Verlinkungen, falls der Pfad auf eine weitere Partition umgeleitet wurde.
Weitere Möglichkeiten erschließen sich daraus:
- Zählen der leeren Dateien:
$ find -L Videos/Movieguides -type f -empty | wc -l
- löschen der leeren Dateien
$ find -L Videos/Movieguides -type f -empty -exec rm -v {} \;
Eine ausführliche Beschreibung ist hier zu finden: https://wiki.ubuntuusers.de/find/
Links ins Internet
Advanced Bash-Scripting Guide An in-depth exploration of the art of shell scripting
The Linux Documentation Page