Buffers, splits and tabs in Vi
Bash creature comforts
GNOME
Notes on window managers (Desktops)
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 lshw -C memory
NVMe SSD details
sudo smartctl -a /dev/nvme0
Block device e.g. disk details
lsblk
CPU details
lscpu
USB bus details
lsusb
Firehose of hardware info
sudo hwinfo
Disk space stats in human friendly format
df -H
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
Use pdfjam to extract pages from pdf. Pdfjam is a user-friendly layer over the powerful pdfpages package.
pdfjam <input file> <page ranges> -o <output file>
(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 USBdd if=linuxmint-22.1-xfce-64bit.iso of=/dev/sdax bs=8M status=progress &&
syncsync 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 :hsplit
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
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.
https://synocommunity.com/ to Package Sources in Package manager.mosh is found in it’s own packagetmux is found in SynoCLI Network Toolssudo 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