Miscellaneous Tools

Miscellaneous Tools

This section covers various useful utilities and tools that don't fit into other categories but are helpful for a Linux system administrator or power user.

tmux

A terminal multiplexer that allows you to run multiple terminal sessions within a single window.

tmux [options] [command]

Options:

Common Key Bindings (after pressing prefix Ctrl+b):

Examples:

# Start a new session
tmux

# Start a named session
tmux new -s mysession

# List sessions
tmux ls

# Attach to a session
tmux attach -t mysession

# Create a new session and run a command
tmux new-session -s backup "rsync -a /home /backup"

# Kill a session
tmux kill-session -t mysession

screen

Another terminal multiplexer (older than tmux but still useful).

screen [options]

Options:

Common Key Bindings (after pressing prefix Ctrl+a):

Examples:

# Start a new session
screen

# Start a named session
screen -S mysession

# List sessions
screen -ls

# Reattach to a detached session
screen -r mysession

# Detach a running session
screen -d mysession

# Create a new session and run a command
screen -dmS backup rsync -a /home /backup

ranger

A console file manager with VI key bindings.

ranger [options] [path]

Options:

Key Bindings:

Examples:

# Start ranger
ranger

# Start in a specific directory
ranger /home/user/Documents

# Create default config files
ranger --copy-config=all

bc

An arbitrary precision calculator language.

bc [options] [file]

Options:

Examples:

# Start interactive bc
bc -l

# Calculate an expression
echo "10 / 3" | bc

# Calculate with precision
echo "scale=4; 10 / 3" | bc

# Calculate using math functions
echo "s(1)" | bc -l  # sine of 1 radian

# Perform calculations from a file
bc -l calculations.txt

# Convert from one base to another (decimal to binary)
echo "obase=2; 42" | bc

# Convert from binary to decimal
echo "ibase=2; 101010" | bc

youtube-dlp

A command-line program to download videos from YouTube and other sites (fork of youtube-dl with more features and regular updates).

youtube-dlp [options] [url]

Options:

Examples:

# Download a video
youtube-dlp https://www.youtube.com/watch?v=dQw4w9WgXcQ

# List available formats
youtube-dlp --list-formats https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Download specific format
youtube-dlp -f 22 https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Download with custom filename
youtube-dlp -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Extract audio only (convert to mp3)
youtube-dlp --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Download video with subtitles
youtube-dlp --write-sub https://www.youtube.com/watch?v=dQw4w9WgXcQ

# Download playlist
youtube-dlp https://www.youtube.com/playlist?list=PLxxx

# Download only items 3-10 from playlist
youtube-dlp --playlist-start 3 --playlist-end 10 https://www.youtube.com/playlist?list=PLxxx

# Update youtube-dlp
youtube-dlp -U

ffmpeg

A complete, cross-platform solution to record, convert and stream audio and video.

ffmpeg [global options] {[input file options] -i input_file} ... {[output file options] output_file} ...

Common Options:

Examples:

# Convert video format
ffmpeg -i input.mp4 output.avi

# Convert video with specific codec
ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mkv

# Extract audio from video
ffmpeg -i input.mp4 -vn output.mp3

# Compress video
ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4

# Trim video (start at 10s, end at 30s)
ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:30 -c:v copy -c:a copy output.mp4

# Resize video
ffmpeg -i input.mp4 -s 1280x720 output.mp4

# Extract frames from video
ffmpeg -i input.mp4 -r 1 frames/frame-%03d.jpg

# Combine images into video
ffmpeg -framerate 24 -pattern_type glob -i 'frames/*.jpg' -c:v libx264 output.mp4

# Add audio to video
ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -shortest output.mp4

# Create a video from an image and audio
ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -c:a aac -shortest output.mp4

pandoc

A universal document converter.

pandoc [options] [input-file]...

Options:

Examples:

# Convert Markdown to HTML
pandoc -f markdown -t html -o output.html input.md

# Convert Markdown to PDF
pandoc input.md -o output.pdf

# Convert HTML to Markdown
pandoc -f html -t markdown -o output.md input.html

# Convert Markdown to DOCX
pandoc -o output.docx input.md

# Convert multiple files to a single output
pandoc -o combined.html input1.md input2.md input3.md

# Create standalone HTML with table of contents
pandoc -s --toc -o output.html input.md

# Convert with a custom template
pandoc --template=template.html -o output.html input.md

ImageMagick

A suite of command-line utilities to create, edit, compose, or convert digital images.

Main Commands:

Examples:

# Convert image format
convert image.png image.jpg

# Resize image
convert input.jpg -resize 800x600 output.jpg

# Maintain aspect ratio, limit width
convert input.jpg -resize 800x output.jpg

# Crop image
convert input.jpg -crop 300x300+100+100 output.jpg

# Rotate image
convert input.jpg -rotate 90 output.jpg

# Add text to image
convert input.jpg -pointsize 24 -fill red -annotate +50+50 'Hello World' output.jpg

# Apply effects
convert input.jpg -charcoal 2 output.jpg

# Create a thumbnail
convert input.jpg -thumbnail 100x100 thumbnail.jpg

# Batch convert multiple images
mogrify -format jpg *.png

# Create a montage
montage *.jpg -geometry 200x200+10+10 montage.jpg

# Identify image information
identify image.jpg

git

A distributed version control system.

git [options] [command] [arguments]

Common Commands:

Examples:

# Initialize a repository
git init

# Clone a repository
git clone https://github.com/username/repository.git

# Check status
git status

# Add files to staging
git add file.txt
git add .  # Add all files

# Commit changes
git commit -m "Commit message"

# Push changes to remote repository
git push origin main

# Pull changes from remote repository
git pull origin main

# Create a new branch
git branch new-feature

# Switch to a branch
git checkout new-feature

# Create and switch to a new branch
git checkout -b new-feature

# Merge a branch
git merge new-feature

# View commit history
git log

# View differences
git diff

# Reset changes
git reset --hard HEAD

# Show remotes
git remote -v

# Add a remote
git remote add origin https://github.com/username/repository.git

grep, awk, sed

These text processing utilities are covered in detail in the Text Processing section.

cmatrix

A terminal-based "Matrix" screen saver.

cmatrix [options]

Options:

Examples:

# Run cmatrix in default mode
cmatrix

# Run with rainbow colors
cmatrix -r

# Run in "screen saver" mode
cmatrix -s

# Run with bold characters
cmatrix -b

neofetch

A command-line system information tool that displays system information alongside an ASCII logo of the Linux distribution.

neofetch [options]

Options:

Examples:

# Display system information
neofetch

# Use custom distro logo
neofetch --ascii_distro debian

# Show image instead of ASCII art
neofetch --image ~/image.png

# Disable color blocks
neofetch --color_blocks off

calcurse

A text-based calendar and scheduling application.

calcurse [options]

Options:

Key Bindings:

Examples:

# Start calcurse
calcurse

# Import iCal data
calcurse -i ical-file.ics

# Export data to iCal format
calcurse -x ical > my-calendar.ics

# Start with a specific date
calcurse -d 2023-06-01

lolcat

Adds rainbow coloring to text output.

lolcat [options] [files]

Options:

Examples:

# Basic usage
ls -la | lolcat

# Show command output with rainbow effect
cat /etc/passwd | lolcat

# Animate the rainbow
fortune | lolcat -a -d 500

# Apply to a file
lolcat /etc/hosts

cowsay

Generates ASCII art of a cow with a message.

cowsay [options] [message]

Options:

Examples:

# Basic usage
cowsay "Hello, World!"

# Using a different cow file
cowsay -f tux "Linux is awesome!"

# Combine with fortune for random quotes
fortune | cowsay

# Dead cow mode
cowsay -d "I'm not feeling well"

# Pipe command output
uptime | cowsay

ncdu

NCurses Disk Usage - a disk usage analyzer with an ncurses interface.

ncdu [options] [directory]

Options:

Key Bindings:

Examples:

# Analyze current directory
ncdu

# Analyze specific directory
ncdu /var

# Don't cross filesystem boundaries
ncdu -x /

# Export result to file
ncdu -o output.file /home

# Import from file
ncdu -f output.file

htop

An interactive process viewer (covered in more detail in Process Management).

nmon

A performance monitoring tool for Linux.

nmon [options]

Options:

Interactive Commands:

Examples:

# Start nmon in interactive mode
nmon

# Capture data to a file (24 snapshots, 30 seconds apart)
nmon -f -s 30 -c 24

# Enable all monitoring
nmon -x

sar

System Activity Reporter - collects, reports, and saves system activity information.

sar [options] [interval [count]]

Options:

Examples:

# Report CPU usage every 2 seconds for 5 times
sar 2 5

# Report memory usage
sar -r 1 3

# Report all statistics
sar -A

# Save data to a file
sar -o output.file 2 10

# Extract data from a file
sar -f output.file

# Report network statistics
sar -n DEV 1 5

pass

A password manager that follows the Unix philosophy.

pass [command] [arguments]

Commands:

Examples:

# Initialize password store
pass init "GPG-ID"

# Add a password
pass insert Email/gmail

# Generate a password
pass generate Email/outlook 15

# Show a password
pass Email/gmail

# Copy a password to clipboard
pass -c Email/gmail

# Edit a password
pass edit Email/gmail

# Remove a password
pass rm Email/gmail

# List all passwords
pass ls

gpg

GNU Privacy Guard - encryption and signing tool.

gpg [options] [files]

Common Commands:

Examples:

# Generate a key pair
gpg --gen-key

# List public keys
gpg --list-keys

# List secret keys
gpg --list-secret-keys

# Encrypt a file for a recipient
gpg --encrypt --recipient user@example.com document.txt

# Decrypt a file
gpg --decrypt document.txt.gpg > document.txt

# Sign a file
gpg --sign document.txt

# Verify a signature
gpg --verify document.txt.gpg

# Export a public key
gpg --export --armor user@example.com > pubkey.asc

# Import a public key
gpg --import pubkey.asc

bat

A cat clone with syntax highlighting and Git integration.

bat [options] [files]

Options:

Examples:

# View a file with syntax highlighting
bat script.py

# Show plain text without additional features
bat --plain file.txt

# View with a specific language
bat --language=json data.txt

# Highlight specific lines
bat --highlight-line 10:20 file.txt

# Use a specific theme
bat --theme=TwoDark file.txt

# List all themes
bat --list-themes

# Show multiple files
bat file1.txt file2.txt

feh

A lightweight image viewer.

feh [options] [files/directories]

Options:

Examples:

# View images
feh image.jpg

# View all images in a directory
feh directory/

# Slideshow with 5-second delay
feh --slideshow-delay 5 *.jpg

# Fullscreen view
feh -F image.jpg

# Recursive view of all images
feh -r directory/

# Randomized slideshow
feh -z --slideshow-delay 3 directory/

# Set window size
feh -g 800x600 image.jpg

tldr

Simplified, community-driven man pages.

tldr [options] [command]

Options:

Examples:

# Show simplified help for a command
tldr tar

# Show help for platform-specific command
tldr -p linux systemctl

# Update local cache
tldr --update

# List all available commands
tldr --list

asciinema

Record and share terminal sessions.

asciinema [command] [options]

Commands:

Options for rec:

Examples:

# Record a terminal session
asciinema rec

# Record with a title
asciinema rec -t "My Terminal Demo"

# Record with idle time limit of 2 seconds
asciinema rec -i 2

# Play a recording from a local file
asciinema play recording.cast

# Play a recording from asciinema.org
asciinema play https://asciinema.org/a/123456

# Upload a recording
asciinema upload recording.cast

pfetch

A lightweight system information tool (similar to neofetch but faster).

pfetch

There are no command-line options, but you can set environment variables to customize the output:

# Show specific information
PF_INFO="ascii title os host kernel uptime pkgs memory" pfetch

# Use a different ASCII art
PF_ASCII="openbsd" pfetch

# Set colors
PF_COL1=4 PF_COL2=5 PF_COL3=6 pfetch

xcompmgr

A simple composite manager for X.

xcompmgr [options]

Options:

Examples:

# Basic compositing with shadows
xcompmgr -c

# Compositing with fade effects
xcompmgr -c -f

# Custom shadow settings
xcompmgr -c -r 8 -o 0.7 -l -10 -t -10

dmenu

A dynamic menu for X, typically used as an application launcher.

dmenu [options]

Options:

Examples:

# Basic application launcher
dmenu_run

# Custom prompt and at the bottom
dmenu_run -p "Run:" -b

# Case-insensitive with custom colors
dmenu_run -i -nb "#222222" -nf "#bbbbbb" -sb "#005577" -sf "#eeeeee"

# Create a custom menu
echo -e "option1\noption2\noption3" | dmenu -p "Choose:"

# Vertical list with 10 lines
ls | dmenu -l 10

zathura

A lightweight document viewer with Vim-like keybindings.

zathura [options] file

Options:

Key Bindings:

Examples:

# Open a PDF file
zathura document.pdf

# Open a specific page
zathura -p 42 document.pdf

# Start in fullscreen mode
zathura -f document.pdf

# Presentation mode
zathura -P 5 presentation.pdf