Useful Linux commands & applications
gdu - disk usage in go with multiprocessor (alternative: ncdu) fd - better find wavemon - analyse wifi pv and progress - watch progress of a command hardinfo - hardwareinfo sshfs - mount remote servers
Crop multiple fotos
for i in *.png; do convert -crop aaaxbbb+ccc+ddd "$i" out/"$i"; done
Where: - aaa is the x offset from the left - bbb is the y offset from the right - ccc is the horizontal size of the output image - ddd is the vertical size of the output image
All in pixels, you can get them by selecting just one image in gimp and looking at the bottom bar for the values ;)
List autostart apps:
ls /etc/init.d
All the files in this directory are actually links to the applications and on boot the OS goes through this directory and starts them all. To list all AutoStart Applications in gnome, list all files under \"autostart\" directories. e.g.:
find / -name \"*autostart*\"
# or
ls -1 /etc/xdg/autostart/ \ /home/$USER/.config/autostart/ \ /usr/share/gdm/autostart/ \ /usr/share/gnome/autostart/
To list all autostart enabled systemd services:
sudo systemctl list-unit-files --type=service --state=enabled --all
List Serial ports Linux
dmesg | grep tty
Glances - A monitoring tool
Install pip:
sudo apt install python3-pip
Install Glances:
pip3 install 'glances[cpuinfo,folders,gpu,graph,ip,raid]'
Network traffic
bmon:
sudo apt install bmon
nethogs:
sudo apt install nethogs
See window info
xprop
See information about a specific window you click on after executing the command.
Test Keyboard keys
xev
Tells you which key you just pressed.
Disk space visualisation
sudo apt install ncdu
ncdu
Version control
sudo apt install git
git <command>
Networking tools
sudo apt install net-tools
ifconfig and other stuff
Text editors
Nano
sudo apt install nano
nano
Vim
sudo apt install vim
vim
File explorers
TUI
Midnight commander
sudo apt install mc
mc
Terminal file explorer which supports mouse and has 2 independent tabs
Ranger
sudo apt install ranger
ranger
Vim-like terminal file explorer.
Graphical
PcmanFM
sudo apt install pcmanfm
pcmanfm
Uses GTK theming
Thunar
sudo apt install thunar
thunar
Nautilus
sudo apt install nautilus
nautilus
Uses GTK theming
Dolphin
sudo apt install dolphin
dolphin
Remote access
sudo apt install openssh-client
sudo apt install openssh-server
ssh <remote>
Wikipedia in Terminal
sudo npm install wikit -g
wikit
Browser in terminal
wget https://github.com/browsh-org/browsh/releases/download/v1.4.12/browsh_1.4.12_linux_amd64.deb\n$ sudo dpkg -i browsh_1.4.12_linux_amd64.deb
Track work hours
npm install -g moro
moro
Fun decryption gimmick
git clone https://github.com/bartobri/no-more-secrets.git
nms
Task management
sudo apt install taskwarrior
# or
brew install task
task
Music players
Terminal
spotify-tui
See official github for instructions.
ncmus
sudo apt install ncmus
ncmus
Graphical
Spotify
snap install spotify
Audacious
sudo apt install audacious
audacious
Rythmbox
sudo apt install rythmbox
rythmbox
Ascii Art Generator
sudo apt install figlet
figlet
See currently logged in Users, and their processes
w
procps
Uptime
uptime
Memory usage
free
Network monitoring
sudo apt install iptraf
iptraf
Monitoring
sudo apt install nmon
nmon
Change shell
chsh -s /bin/zsh
Add user to sudoers file
usermod -aG sudo <username>
adduser <username> sudo
Scan network
# Ping broadcast adress (ping 192.168.1.255)
arp -a
Scan wifi networks
nmcli dev wifi
Show serial data
screen /dev/cu.usbserial-26401 115200
Show battery in shell
sudo apt install acpi
acpi -V
Data Backup & Synchronization
Unison: Data Synchronization
Rsync: Data Backup
Rsync is a mirroring tool; Unison is a synchronizer.
My zsh shell setup
Install oh-my-zsh
sh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"
Install spaceship prompt via npm
npm install -g spaceship-prompt
Find package associated to command
dpkg -S $(which <command>)
Finds the package that is associated with the given command
Watch
watch
Repeats an command infinite times. Can be set with an interval.
Example: CPU frequency
sudo watch -n 1 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
See available keysyms
xmodmap -pke
If the XF86* keysyms do not work for you, you can see the available keysyms for your computer by executing this command.
Hollywood
sudo apt install hollywood
hollywood
Did you ever wanted to feel like a real hacker?
Star Wars (kinda?)
telnet towel.blinkenlights.nl
telnet is long gone and replaced by ssh, but this, this has to be preserved by mankind! (Requires internet)
Kdenlive
sudo apt install kdenlive
A nice video editor for linux and windows. Made for KDE, but works on other platforms as well.
Note: In order to change themes on Ubuntu, you must install the breeze theme like this:
sudo apt install breeze
List services
systemctl list-unit-files
Ever wanted to know all available systemd services?
Loadable Kernel Modules
All these commands are available in the package modutils
Info about a kernel module
modinfo <module-name>
Insert an LKM into the kernel.
insmod
Remove an LKM from the kernel.
rmmod
Determine interdependencies between LKMs.
depmod
Kerneld daemon program
kerneld
Display symbols that are exported by the kernel for use by new LKMs.
ksyms
List currently loaded LKMs.
lsmod
Display contents of .modinfo section in an LKM object file.
modinfo
Insert or remove an LKM or set of LKMs intelligently
modprobe
For example, if you must load A before loading B, Modprobe will automatically load A when you tell it to load B.