Some useful Linux commands and what they do


Blog What I'm writing The status quo

A few things that have helped me in my Linux journeys. I'll add to these as I find new helpful things.


Where -p 3 means priority error, -x provides extra message information, and -b means since last boot. Useful for finding out if a service (systemd) didn't start or errored out. Of course, this command assumes you run systemd as an init process.

journalctl -p 3 -xb

What video card driver is running?

lspci -k | grep -EA3 'VGA|3D|Display'

Reset X screen resolution. Useful if a game or a app leaves your screen all screwy.

xrandr -s 0

This remaps capslock ( a useless key by default ) to compose, so you can easily type in œ and ů etc, without needing to worry about what your compose key is. For a permanent solution, place this line in an init script like .xinitrc or .bashrc.

Note that in KDE this won't work, as it ignores both of these startup scripts. This page explains what to do.

setxkbmap -option compose:caps

Installing Arch Linux, and not getting any internet connectivity with a USB tethered phone despite setting it up using ip link? Do dhcpcd name-of-device and it should connect.

Can't start Network Manager on Arch Linux? Although the app is called networkmanager when you download it, the actual installed app is called NetworkManager - note the capitalisation. So, to enable and run it, it's:

sudo systemctl {enable|start} NetworkManager

More to come.

©1996-2020 Peter Greenwell Text and images Creative Commons License