linux:notes:misc
Table of Contents
Information
- Miscellaneous commands, paths, info, and syntax for Linux
- Most of this was previously under the “Notable Folders and Commands” section at the bottom of distro notes
Shortcuts
/usr/share/applications
~/.local/share/applications
Icons
/usr/share/icons/hicolor
~/.local/share/icons/hicolor
Get Release/OS Info
cat '/etc/os-release'
cat '/etc/os-release' | grep 'PRETTY_NAME'
Fedora
Keyboard Shortcuts
Adoptium Java
- Potentially useful for F42
Repo
sudo dnf install 'adoptium-temurin-java-repository'
sudo dnf config-manager 'setopt' 'adoptium-temurin-java-repository'.'enabled'='1'
Install
sudo dnf install 'temurin-11-jdk'
JAVA_HOME='/usr/lib/jvm/temurin-11-jdk'
Non-Temurin/Fedora
sudo dnf install 'java-openjdk' --setopt='adoptium-temurin-java-repository.enabled=0' --exclude='temurin*'
Anaconda Module Blacklists
sudo -e '/etc/modprobe.d/anaconda-blacklist.conf'
DNF
List
Repos
sudo dnf repolist
gio open '/etc/yum.repos.d'
Installed Packages
sudo dnf list --installed
sudo dnf list --installed | grep x
Package Files
sudo dnf repoquery -l x
sudo dnf repoquery -l x | grep 'bin'
History
sudo dnf history list
sudo dnf history undo x
updates-testing Repos
sudo dnf config-manager 'setopt' 'updates-testing'.'enabled'='1'
sudo dnf config-manager 'setopt' 'rpmfusion-'*'-updates-testing'.'enabled'='1'
Add Repo
sudo dnf config-manager addrepo --from-repofile='x'
sudo dnf config-manager addrepo --from-repofile='https://dl.winehq.org/wine-builds/fedora/40/winehq.repo'
Tor Socks
Looks useful for using
dnfon restrictive networks
sudo dnf install tor
sudo systemctl enable tor.service --now
sudo torsocks dnf upgrade --refresh
Autoremove Fix
- Removes the initially-installed kernel in order to fix
dnf autoremoveif it's broken
sudo dnf list --installed 'kernel'*
sudo dnf remove *5.3.7* && sync
SELinux Re-label
sudo touch '/.autorelabel'
openSUSE
Zypper
Show Locked Packages
zypper locks
Find Orphans
zypper packages --orphaned
Remove Package and Deps
sudo zypper remove --clean-deps 'x'
Show Installed Patterns
sudo zypper patterns --installed-only
Folder
ls '/etc/zypp/repos.d'
List
zypper repos --priority
Repo Packages
PipeWire
Set Default Rate
mkdir -p ~/'.config/pipewire/pipewire.conf.d' && nano ~/'.config/pipewire/pipewire.conf.d/99-custom.conf'
context.properties = {
default.clock.rate = 192000
default.clock.allowed-rates = [ 44100 48000 88200 96000 192000 ]
}
User Config
- Copy main config to user folder
mkdir -p ~/'.config/pipewire/pipewire.conf.d' && cp '/usr/share/pipewire/pipewire.conf' ~/'.config/pipewire/pipewire.conf.d/99-custom.conf'
nano ~/'.config/pipewire/pipewire.conf.d/99-custom.conf'
Read Main Config
gio open '/usr/share/pipewire/pipewire.conf'
nano '/usr/share/pipewire/pipewire.conf'
WirePlumber Settings Reset
sudo rm -Rf ~gdm/'.local/state/wireplumber' ~/'.local/state/wireplumber'
rm -Rf ~/'.local/state/wireplumber'
GPG Keys
Check Keys
rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'
Remove Keys
sudo rpm -e x
Re-generate Thumbnails
rm -Rf ~/'.cache/thumbnails'
GNOME
List gsettings
- Change
xto schema or omit it to show all settings
gsettings list-recursively 'x'
App Grid Reset
gsettings reset 'org.gnome.shell' 'app-picker-layout'
Reset Last Settings Pane
- 2025/07/13: Mouse settings caused crash possibly related to
glvsvulkan
gsettings reset 'org.gnome.Settings' 'last-panel'
GNOME Software Maintenance
pkcon -c '1' refresh && pkcon update
fstrim
sudo fstrim --verbose --all
Tracker
- Aka
localsearchandtinysparql
localsearch reset --filesystem
tracker3 reset --filesystem --rss
journalctl
sudo journalctl --sync --flush --rotate --update-catalog --vacuum-time='1d'
sudo journalctl --verify
Mesa Shader Cache Clear
rm -Rf ~/'.cache/mesa_shader_cache'*'/'*
GNOME Monitors Reset
sudo rm -fv ~/'.config/monitors.xml' '/etc/xdg/monitors.xml'
PulseAudio Reset
rm -fv ~/'.config/pulse/'*
Xorg Debug
journalctl -e _COMM='gdm-x-session'
gio open ~/'.local/share/xorg/Xorg.0.log'
mousepad '/var/log/Xorg.0.log'
gio open ~/'.local/share/xorg/'
Verify DRI3
LIBGL_DEBUG='verbose' glxinfo | grep 'libgl'
Wine Hard-Kill
killall -9 'wine' 'wineserver' 'wineboot.exe' 'winedevice.exe' 'winemenubuilder'
GpuTest
Execute
HDTV
- 1280×720
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1280' /height='720'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1280' /height='720'
/fullscreen /benchmark /benchmark_duration_ms='15000'
NVIDIA Optimus
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && __NV_PRIME_RENDER_OFFLOAD='1' __GLX_VENDOR_LIBRARY_NAME='nvidia' ./GpuTest /test='fur' /width='1280' /height='720'
FHD
- 1920×1080
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1920' /height='1080'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1920' /height='1080'
/fullscreen /benchmark /benchmark_duration_ms='15000'
UHDTV1
- 3840×2160
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='3840' /height='2160'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='3840' /height='2160'
/fullscreen /benchmark /benchmark_duration_ms='15000'
Cleanup
rm -Rf '/tmp/GpuTest_Linux_'* && cd ~ && sync
Network Link Speed
cat '/sys/class/net/'*'/speed'
Show Sensors
sudo dnf install 'lm_sensors' -y
sudo sensors-detect --auto && sudo watch -n0.5 sensors
Show CPU Frequency
grep 'MHz' '/proc/cpuinfo'
watch --interval '0.5' grep \'cpu MHz\' '/proc/cpuinfo'
OpenSSL Supported Ciphers
openssl ciphers -v | awk '{print $2}' | sort | uniq
Firmware Update
fwupdmgr
sudo fwupdmgr refresh --force && sudo fwupdmgr update --verbose
Flatpak
Update
flatpak update && sudo flatpak update
Partition Information
- Both commands present the same information
df -hT
df --human-readable --print-type
Encryption Information
sudo cryptsetup -v status '/dev/dm-0'
RAID
Controller Details
- This can be used to get the OpROM version for Intel RST
sudo mdadm --detail-platform
Create Software RAID
Fedora Anaconda
- Compared to old notes, the RAID device needs to be under
/dev/md/instead of just/dev/to appear on Anaconda
sudo mdadm --create '/dev/md/raid0' --name='RAID' --level='0' --raid-devices='2' '/dev/nvme0n1' '/dev/sda' --verbose
Old
Came from old notes; this used to work for an Acer Predator laptop that had 3 SSDs
sudo mdadm --create '/dev/md0' --name='RAID' --level='0' --raid-devices='3' '/dev/sda' '/dev/sdb' '/dev/sdc' --verbose
Fix MacBook Battery CPU Throttling
- 2023/07/17: This solves a MacBook Pro Mid-2010 with Intel C2D from being stuck at 1.5GHz CPU due to a missing internal battery, by unlocking full-performance
sudo dnf install 'msr-tools'
sudo wrmsr --all '0x1A0' '0x4000850089'
Verify
0x4000850089is the expected value
sudo rdmsr --all '0x1A0'
VGA Switcheroo Power States
sudo cat '/sys/kernel/debug/vgaswitcheroo/switch'
ACPI Tables
sudo strings '/sys/firmware/acpi/tables/DSDT' | grep -i 'windows ' | sort
Old Method
- Provides more information as to what certain
_OSIvalues do and how they compare - In
dsdt.dsl, look for_OSIvalues, along withWindowsandLinux
sudo dnf install 'acpica-tools'
sudo cp --force '/sys/firmware/acpi/tables/DSDT' ~/'dsdt.dat'
cd ~ && iasl -d ~/'dsdt.dat'
gio open ~/'dsdt.dsl'
sudo dnf remove 'acpica-tools' && sync
Display EDID Info
Custom Resolutions
Generate Modeline
- Use
--reducedonly for LCD/Non-CRT displays, and only as-needed 3) - Syntax is
horizontal(width),vertical(height) andrefresh rate
cvt '3840' '2160' '60'
cvt --reduced '3840' '2160' '60'
--reduced
Temporarily Apply
- Changes are lost after reboot
- Values after
--newmodeare from the above generate command, and is everything afterModeline
xrandr --newmode "3840x2160R" 533.00 3840 3888 3920 4000 2160 2163 2168 2222 +hsync -vsync
xrandr --addmode 'HDMI-A-0' '3840x2160R'
xrandr --output 'HDMI-A-0' --mode '3840x2160R'
Verify
xrandr --verbose | grep *current
Permanently Apply
Identifieris the name of the port on the GPU the display is connected toModelineis from the above generate command, including the textModelinePreferredModeis the custom resolution name generated
Section "Monitor"
Identifier "HDMI-A-0"
Modeline x
Option "PreferredMode" "3840x2160R"
EndSection
HT/SMT Information
grep -e "processor" -e "core id" -e "^$" /proc/cpuinfo
Compiling
Linkers
sudo dnf install 'binutils-gold'
sudo dnf install 'mold'
sudo update-alternatives --config 'ld'
ls -la '/etc/alternatives/ld'
Check Linker
xis path to an executable
readelf --string-dump='.comment' x
[ 5d] mold 2.34.1 (compatible with GNU ld) [ 5c] clang version 19.1.0 (Fedora 19.1.0-1.fc41)
Optimal GCC compiler flags
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'
Generate QR
sudo dnf install 'qrencode'
qrencode -o ~/'x.png' 'x'
qrencode -o ~/'x.png' -s '6' 'https://wiki.realmofespionage.xyz/linux;notes;misc'
Mesa Envs
mesa_glthread='true'
vblank_mode='0'
vblank_mode='3'
MESA_LOADER_DRIVER_OVERRIDE='zink'
MESA_VK_WSI_PRESENT_MODE='immediate'
HUD
- TODO: Scaling sizes
mesa_glthread='false' GALLIUM_HUD='cpu0+cpu1+cpu2+cpu3;cpu4+cpu5+cpu6+cpu7;fps'
mesa_glthread='true' GALLIUM_HUD='cpu0+cpu1+cpu2+cpu3;cpu4+cpu5+cpu6+cpu7;API-thread-offloaded-slots+API-thread-direct-slots+API-thread-num-syncs;fps'
DXVK_HUD='full'
VK_INSTANCE_LAYERS='VK_LAYER_MESA_overlay' VK_LAYER_MESA_OVERLAY_CONFIG='fps,gpu_timing'
VK_INSTANCE_LAYERS='VK_LAYER_MESA_overlay' VK_LAYER_MESA_OVERLAY_CONFIG='help' vkcube
TODO: Might need a VK dev package?
MESA_LOADER_DRIVER_OVERRIDE='zink' VK_INSTANCE_LAYERS='VK_LAYER_MESA_overlay' VK_LAYER_MESA_OVERLAY_CONFIG='fps,gpu_timing' glxgears
SDL Envs
SDL Enable/Disable are about the system cursor being shown with the app's cursor
SDL_VIDEO_DRIVER='x11'
SDL_VIDEO_DRIVER='wayland'
SDL_ENABLE='1'
SDL_DISABLE='1'
OSU_SDL3='1'
Wine Envs
DISPLAY=might not be required on newer Wine for Wayland
WINEDLLOVERRIDES='dsound=n'
WINEDLLOVERRIDES='winemenubuilder.exe=d'
DISPLAY=
WINEDEBUG=''
Privacy
Clear Terminal History
history -cw
Create 7z Password Archive
- Change
7ZIPNAMEin7ZIPNAME.7zto the desired archive name - Change
PASSin-pPASSto the desired password - Change
xto the file or folder to add to the archive
7za a '7ZIPNAME.7z' -p'PASS' 'x'
7za a 'x.7z' -p'x' 'x'
oathtool
xis a secret without&digits=6
sudo apt install 'oathtool'
sudo dnf install 'oathtool'
oathtool --totp -b 'x'
Remove EXIF data
sudo apt install 'libimage-exiftool-perl'
sudo dnf install 'perl-Image-ExifTool'
exiftool -all= *.* -overwrite_original
/usr/local/www/wiki/data/pages/linux/notes/misc.txt · Last modified: by Sean Rhone
