Buffers, splits and tabs in Vi
Bash creature comforts
GNOME
Notes on window managers (Desktops)
Notes on terminal emulators
Synology
Bug reports
As a general note, the arch wiki is an absolutely fabulous resource for troubleshooting and just informational reading about all things Linux.
Commandline options kernel was started with
cat /proc/cmdline
Distribution version details
lsb_release -a
Kernel details
uname -a
Machine serial number
sudo dmidecode -s system-serial-number
Machine bios version
sudo dmidecode -s bios-version
System log (add -no-tail when piping to something)
journalctl --system -S "2024-03-22 14:00"
Get display details
edid-decode /sys/class/drm/card0-eDP-1/edid
Memory (RAM) details
sudo dmidecode -t memory
NVMe SSD details
sudo smartctl -a /dev/nvme0
Block device e.g. disk details
lsblk
CPU details
cat /proc/cpuinfo
e.g. Get CPU frequency
cat /proc/cpuinfo | grep -i mhz
Thermals:
cat /sys/class/thermal/thermal_zone*/temp
/sys/class/hwmon
This is a virtual filesystem interface managed by the Linux kernel’s hardware monitoring system and carries information about various devices.
You can get a list of names
cat /sys/class/hwmon/hwmon*/name
On my Thinkpad I have a thinkpad entry on hwmon6
cat /sys/class/hwmon/hwmon7/fan1_input
The sensors utility from the lm-sensors package will give nicelt formatted
system sensor information.
USB bus details
lsusb
Firehose of hardware info
sudo hwinfo
Disk space stats in human friendly format
df -H
Process, CPU and memory information: htop
GPU information: intel_gpu_top
or: nvtop (https://github.com/Syllo/nvtop)
For Intel GPUs setcap may be needed to set enable CAP_PERFMON capabilities
on the binary.
sudo setcap cap_perfmon+ep intel_gpu_top
Battery
cat /sys/class/power_supply/BAT0/uevent
Service status
sudo systemctl status <service name>
Enable, start and stop to control services
sudo systemctl enable <service name>
sudo systemctl start <service name>
sudo systemctl stop <service name>
Look through /sys/class/drm/ for the devices. Find which one’s /enabled
value is “enabled” and then run
cat /sys/class/drm/card1-eDP-1/edid | edid-decode
cat /sys/power/state
cat /sys/power/mem_sleep
Detailed description of the values are in the kernel docs
Change with
echo s2idle | sudo tee /sys/power/mem_sleep deep
Also see these kernel docs
List all available printers
lpstat -pa
List current printer jobs
lpstat
Output will be of the form
Brother_HL_L2300-181 kg 165888 Sun 21 Sep 2025 07:48:03 PM EDT
Here the -181 is the job number.
Remove a print job
lprm <job number>
List jobs that are not completed
lpstat -W not-completed
Restart print service (sometimes needed to reconnect to a printer)
sudo systemctl restart cups
Size of directory
du -sh <directory>
Used and free sizes of all mount points
df -H
List directory contents recursively
ls -R
Find and print all empty directories
find . -type d -empty -print
Delete all empty directories
find . -type d -empty -delete`
Find and print all files with given extension
find Takeout -name "*.json" -type f -print
Spot check microphone: You’ll get a cool bar in your terminal that shows sound level.
arecord -vv -f dat /dev/null
Record 5 seconds of audio at 44 kHz and 16 bit resolution, then play it back.
arecord -d 5 -r 44000 -f S16_LE test.wav
aplay test.wav
Redirect stdout of cmd to std.out and stderr to `std.err
cmd > std.out 2> std.err
Redirect stdout and stderr to `out.txt
cmd 2> out.txt
Networking interface configuration
ifconfig
Trace route to host
mtr 8.8.8.8
Use iPerf3.
Start iperf3 server on target machine “hostname”
iperf3 -s
Connect to “hostname” and determine speed of connection
iperf3 -c hostname
Grant “user2” access to your display on the (non-network) local machine
xhost + local:user2
Open a login shell as “user2”
su - user2
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=output.pdf input.pdf
Compression settings are
/screen = 72dpi
/ebook = 150 dpi
/printer = 300 dpi
/prepress = 300 dpi
Use pdfjam for joining files together, selecting pages, reducing several source pages onto one output page, etc.,
It is a user-friendly layer over the powerful pdfpages package.
pdfjam <input file> <page ranges> -o <output file>
It’s annoying to download the whole tex distribution when all we want to do is
convert markdown to a simple pdf using pandoc. We can use the pdfroff package.
pandoc \
*.md \
-f markdown \
--metadata title="My manuscript" \
-o ms.pdf \
--pdf-engine=pdfroff
Use ImageMagick
(Use it for booting Linux, updating firmware, anything where a bootable iso image is supplied)
lsblk. say it’s /dev/sdxdd to create a bootable USB\dd if=linuxmint-22.1-xfce-64bit.iso of=/dev/sdax bs=8M status=progress &&
sync
The sync at the end ensures all the data is written to the drive.
status=progress is nice to get an indication nothing’s frozen up.
Multicast DNS (mDNS) enables machines to resolve devices on the LAN using
<hostname>.local scheme. The implementation for Linux is Avahi. Ubuntu
installs this automatically, but some other distributions, like openSUsE, do
not. The arch wiki page is a great
resource for setting it up yourself.
Find devices via mDNS
avahi-browse -a
Find mDNS name for given address
avahi-resolve-address 192.168.8.1
getent hosts 192.168.8.1
ControlMaster can be used to persist/reuse ssh connections e.g. for rsync
Example: add to ~/.ssh/config
ControlMaster auto
ControlPath ~/.ssh/control:%C
ControlPersist 5m
Open file for editing in current window :edit file.txt
Switch to buffer (with autocomplete) :b <tab>
Split pane :vsplit or :split
Go to pane CTRL + W followed by arrow keys. On NeoVim you can also click on
the split.
Go to end of file: G
Go to 34% of the file: 34%
Copy large number of lines.
may`ad`aOpen file in new tab :tabedit <filename>
Go to second tab 2gt. On NeoVim you can also click on the tab.
Wrap paragraph gq}
Check if compiled with clipboard support :echo has('clipboard')
For Vim you can do vim --version | grep clipboard but not for NeoVim.
Paste from clipboards (When compiled with +clipboard option
"+p
"*p
Builtin file explorer: netrw
I prefer the built in packages feature to any external plugin manager: less
complexity to manage. Just git clone the plugin into
~/.config/nvim/pack/<org>/start/ where <org> is some arbitrary name you
chose to organize plugins. I use the repo owner’s handle.
NeoVim has a built in LSP client! Use nvim-lspconfig to get a good default configuration (Follow the instructions there to install it).
Then to your ~/.config/nvim/init.lua add
vim.lsp.enable('gopls')
vim.diagnostic.config({ virtual_text = false, virtual_lines = { current_line = true }, })
The first line enables a particular LSP server, in this case the golang server
gopls.
The second line configures how you want the diagnostic messages from the server displayed. This particular configuration shows the message as a “popup” line when your cursor lands on the line with the error:

If you instead use
vim.diagnostic.config({ virtual_text = true, })
The error message is always visible and looks like:

In .vimrc/init.vim
" Auto save for markdown files in insert mode
" https://stackoverflow.com/a/60095826
" https://stackoverflow.com/a/63589188
autocmd BufNewFile,BufRead *.md :autocmd TextChangedI <buffer> if &readonly == 0 | silent write | endif
" _Esc_ ape from insert mode is slow
" https://vi.stackexchange.com/a/20220
set tttimeoutlen=5
Open a new tab
<ctrl>+b c
Switch to a tab
<ctrl>+b 0...9
Add setw -g mouse on in ~/.tmux.conf to enable scrollback with mouse scroll.
sudo apt install git flatpak simple-scan
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.mozilla.firefox
flatpak install flathub io.github.dosbox-staging
flatpak install flathub net.sf.VICE
flatpak run --filesystem=/home/kghose/RetroComputing/dosbox io.github.dosbox-staging
flatpak run --filesystem=/home/kghose/RetroComputing/c64/ net.sf.VICE
flatpak run org.mozilla.firefox
flatpak info --show-permissions org.mozilla.firefox
fwup is the easiest but may not have the most up to date firmware from the manufacturer. Follow the basic usage flow described on the project page.
fwupdmgr get-updates
fwupdmgr update
Manufacturers may put out a bootable image. You can use dd to create a
bootable USB (steps are noted on this page).
From ask Ubuntu
sudo apt-get autopurge snapd
sudo apt-mark hold snapd
Follow the instructions on the Firefox page
List all the repositories dnf searches through
dnf repolist --enabled
Remove a repository (has to be done “manually”)
rm /etc/yum.repos.d/file_name.repo
Prevent Bluetooth being turned on automatically after wakeups or reboots:
In /etc/bluetooth/main.conf set AutoEnable=false
Displaying cover art. Use --no-audio-display to prevent this.intel_gpu_top / nvtop