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:
-s session-name
: Start a new session with the specified name-a
: Attach to existing session-d
: Detach from session-l
: List sessions-c
: Execute command in a new session
Common Key Bindings (after pressing prefix Ctrl+b):
c
: Create a new windowp
: Switch to the previous windown
: Switch to the next window0-9
: Switch to window by number%
: Split window vertically"
: Split window horizontallyarrow keys
: Navigate between panesd
: Detach from session[
: Enter copy mode (use arrows to move,q
to quit)]
: Paste from buffer:
: Enter command mode
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:
-S session-name
: Start a new session with the specified name-r
: Reattach to a detached screen session-d
: Detach a screen session-ls
: List running screen sessions-x
: Attach to a session that is already attached elsewhere
Common Key Bindings (after pressing prefix Ctrl+a):
c
: Create a new windowp
: Switch to the previous windown
: Switch to the next window0-9
: Switch to window by numberS
: Split window horizontally|
: Split window verticallytab
: Navigate between regionsd
: Detach from session[
: Enter copy mode]
: Paste from buffer:
: Enter command mode
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:
--copy-config=file
: Create a copy of the specified configuration file--clean
: Remove the unused directory from the cache--choosefile=file
: Choose a file and store the result in the provided file--choosedir=file
: Choose a directory and store the result in the provided file
Key Bindings:
h/j/k/l
: Navigation (left/down/up/right)gg/G
: Go to top/bottomH/M/L
: Go to top/middle/bottom of visible area/
: Searchn/N
: Next/previous search resultf
: Find (search as you type)space
: Select current fileyy
: Copy filedd
: Cut filepp
: Paste fileA
: Rename file with cursor at the endi
: Rename file with cursor at the beginninga
: Rename file with cursor after the extensioncw
: Rename selected partdd
: Cut file(s)dD
: Delete file(s)q
: Quit
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:
-l
: Use the math library (enables sine, cosine, etc.)-i
: Interactive mode-q
: Quiet mode (don't print welcome message)
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:
-f format
: Select video format-o template
: Output filename template-a file
: Read URLs from file--write-sub
: Write subtitle file--list-formats
: List available formats--extract-audio
: Convert video to audio--audio-format FORMAT
: Specify audio format (mp3, m4a, etc.)--playlist-start NUMBER
: Start at playlist item--playlist-end NUMBER
: End at playlist item
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:
-i
: Input file-c:v
: Video codec-c:a
: Audio codec-b:v
: Video bitrate-b:a
: Audio bitrate-r
: Frame rate-s
: Frame size-t
: Duration-ss
: Start time-to
: End time-f
: Force format
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:
-f/--from FORMAT
: Specify input format-t/--to FORMAT
: Specify output format-o/--output FILE
: Write output to FILE-s/--standalone
: Create standalone document--template FILE
: Use FILE as template--toc
: Include table of contents--pdf-engine=ENGINE
: Use ENGINE for PDF output
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:
convert
: Convert between image formats and modify imagesmogrify
: Transform images in-placeidentify
: Describe the format and characteristics of an imagecomposite
: Compose images togethermontage
: Create a composite image from multiple imagesdisplay
: Display images on screen (X11)
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:
init
: Create a new repositoryclone
: Clone a repositoryadd
: Add files to staging areacommit
: Commit changesstatus
: Show repository statusdiff
: Show changes between commitsbranch
: List, create, or delete branchescheckout
: Switch branches or restore filesmerge
: Merge branchespull
: Fetch from and integrate with another repositorypush
: Update remote repositorylog
: Show commit logs
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:
-a
: Asynchronous scroll-b
: Bold characters on-B
: All bold characters-c
: Use console default colors-C
: Use color X-f
: Force the Linux $TERM type-l
: Linux mode-n
: Turn off bold characters-o
: Use old-style scrolling-r
: Rainbow mode-s
: "Screen saver" mode-u
: Update delay (0-9)-x
: X window mode
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:
--config FILE
: Specify a custom config file--color_blocks on/off
: Enable/disable color blocks--bar_char 'CHARACTER'
: Character for bars--off
: Disable all colors and ASCII logo--ascii_distro DISTRO
: Use custom distro art--crop_mode mode
: Crop mode (normal, fit, fill)--image IMAGE
: Display an image--image_size SIZE
: Specify image size
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:
-c file
: Specify the calendar file-a file
: Specify the appointment file-t file
: Specify the todo file-i file
: Import iCal data-x [format]
: Export data-D dir
: Specify the configuration directory-d date
: Start with specified date
Key Bindings:
- Arrow keys: Navigate
Tab
: Switch between panelsa
: Add an appointmentt
: Add a taskd
: Delete an iteme
: Edit an itemv
: View an itemg
: Go to specific dateq
: Quit
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:
-f
: Force color even when stdout is not a tty-p
: Print plain output, no rainbow effect-s
: Animate the rainbow effect-a
: Animation speed-d
: Duration of animation-F
: Frequency of colors
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:
-b
: "Borg" mode (uses ==)-d
: "Dead" mode (uses XX)-g
: "Greedy" mode (uses $)-p
: "Paranoid" mode (uses @@)-s
: "Stoned" mode (uses )-t
: "Tired" mode (uses --)-w
: "Wired" mode (uses OO)-y
: "Youthful" mode (uses ..)-f cowfile
: Use a specific cow file
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:
-x
: Don't cross filesystem boundaries-r
: Read-only mode (disables file deletion)-q
: Quiet mode (no user interface)-e
: Enable extended information-C
: Color scheme
Key Bindings:
up/down
: Navigateright/enter
: Enter directoryleft
: Go to parent directoryd
: Delete selected file/directoryn
: Sort by names
: Sort by sizeC
: Sort by item countg
: Show percentage/graphi
: Show informationq
: Quit
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:
-f
: Save data to a file-s seconds
: Time between each update-c count
: Number of iterations-t
: Include top processes-x
: Enable all statistics
Interactive Commands:
h
: Show helpq
: Quitc
: CPU statsm
: Memory statsd
: Disk statsn
: Network statst
: Top processesv
: Verbose moder
: Resources
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:
-A
: Report all information-u
: CPU utilization-r
: Memory utilization-b
: I/O and transfer rate statistics-d
: Block device activity-n
: Network statistics-f file
: Extract data from file-o file
: Save data to file-s time
: Set start time-e time
: Set end time
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:
init
: Initialize the password storels
: List passwordsshow
: Show passwordinsert
: Insert a new passwordedit
: Edit a passwordgenerate
: Generate a new passwordrm
: Remove a passwordmv
: Move a passwordcp
: Copy a passwordgit
: Run git command on the password store
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:
--encrypt
: Encrypt data--decrypt
: Decrypt data--sign
: Make a signature--verify
: Verify a signature--gen-key
: Generate a new key pair--list-keys
: List keys--import
: Import keys--export
: Export keys--delete-key
: Delete keys
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:
-p, --plain
: Show plain mode (no line numbers, etc.)-l, --language
: Set the language for syntax highlighting-H, --highlight-line
: Highlight specific lines-n, --number
: Show line numbers-A, --show-all
: Show all (non-printable characters)--theme
: Set the theme for syntax highlighting--list-themes
: List available themes--list-languages
: List supported languages
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:
-F, --fullscreen
: Fullscreen mode-d, --draw-filename
: Display filename-Z, --auto-zoom
: Zoom to fit window-r, --recursive
: Load files recursively from directories--slideshow-delay seconds
: Set slideshow delay--start-at file
: Start at specific file-g, --geometry WxH
: Set window size-z, --randomize
: Randomize filelist
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:
-l, --list
: List all available commands-p, --platform
: Show page for specific platform-u, --update
: Update local cache-v, --version
: Show version information
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:
rec
: Record terminal sessionplay
: Replay recorded sessioncat
: Print full output of recorded sessionupload
: Upload recorded sessionauth
: Manage recordings ownership
Options for rec:
-i, --idle-time-limit
: Limit idle time-t, --title
: Set title of the recording-c, --command
: Command to record-y, --yes
: Answer "yes" to all prompts-q, --quiet
: Be quiet (suppress all notices/warnings)
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:
-c
: Client-side compositing with soft shadows-C
: Client-side compositing with shadows (without shaping)-f
: Fade windows in/out-F
: Fade windows in/out more slowly-D time
: Specify fade-in time-r radius
: Set shadow radius-o opacity
: Set shadow opacity-l offset
: Set shadow offset to the left-t offset
: Set shadow offset to the top
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:
-b
: Place dmenu at the bottom-f
: Grab the keyboard-i
: Case-insensitive matching-l lines
: Vertical list with specified number of lines-p prompt
: Define a custom prompt-fn font
: Set font-nb color
: Set normal background color-nf color
: Set normal foreground color-sb color
: Set selected background color-sf color
: Set selected foreground color
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:
-p page
: Open specific page-f fullscreen
: Start in fullscreen mode-P seconds
: Set presentation mode delay-c config
: Use alternate config file
Key Bindings:
j/k
: Scroll down/uph/l
: Scroll left/rightJ/K
: Page down/upgg
: Go to first pageG
: Go to last pagenG
: Go to page n/
: Searchn/N
: Next/previous search resulta
: Adjust to widths
: Adjust to heightf
: Toggle fullscreeni
: Toggle inverted colorsr
: Rotate+/-
: Zoom in/out=
: Set zoom to 100%
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