Command documentation sourced from the linux-command project This comprehensive command reference is part of the linux-command documentation project.
joe - Joe's Own Editor
The joe command is a powerful, full-screen text editor that provides a user-friendly interface while maintaining powerful editing capabilities. Joe's Own Editor was designed to be easy to use for beginners while offering advanced features for experienced users. It can emulate other popular editors like Emacs, WordStar, and Brief, making it familiar to users coming from different editing environments. Joe supports multiple files, syntax highlighting, search and replace, macros, and extensive customization options.
Basic Syntax
joe [options] [filename...]
joe [+line_number] [options] [filename...]
joe [-help] [-version] [-syntax] [-wordstar] [-emacs] [-pico] [-nosta] [-noxon] [-orphan] [-dopadding] [-lightoff] [-beep] [-keepup] [-autoindent] [-indentfirst] [-overtype] [-spaces] [-notab] [-istep n] [-linums] [-lmsg] [-bis] [-asis] [-crlf] [-nobackups] [-backups] [-autoload] [-force] [-nolocks] [-columns n] [-lines n] [-mouse] [-context n] [-skiptop n] [filename...]
Core Editing Modes
Editor Emulations
- joe mode - Default Joe editor mode
- wordstar mode - WordStar emulation for compatibility
- emacs mode - Emacs-like keybindings
- pico mode - Pico-like interface
- brief mode - Brief editor emulation
Command Line Options
File and Buffer Options
+line_number- Start editing at specified line number--autoindent- Enable auto-indentation mode--indentfirst- Auto-indent first line--overtype- Start in overtype mode instead of insert mode--autoload- Load specified files into buffers--orphan- Put each file in separate buffer--force- Force newline at end of file
Tab and Indentation Options
--notab- Convert tabs to spaces--spaces- Insert spaces instead of tabs--tab <number>- Set tab width to specified number--istep <number>- Set auto-indent step size
Display and Interface Options
--linums- Enable line numbers--lmsg- Show line message--nosta- Don't display status line--keepup- Keep status line at top of screen--columns <number>- Set screen width to specified columns--lines <number>- Set screen height to specified lines--skiptop <number>- Skip specified number of top lines--context <number>- Show context lines--mouse- Enable mouse support (if available)
Backup and File Handling
--backups- Create backup files--nobackups- Don't create backup files--overwrite- Overwrite existing files without warning--nolocks- Don't use file locking
Search and Behavior Options
--asis- Preserve original file format--crlf- Use Windows line endings (CRLF)--noxon- Disable XON/XOFF flow control--beep- Enable bell on errors--lightoff- Turn off highlighting after block operations
Information Options
--help- Display help information--version- Display version information--syntax- Display syntax highlighting information--nonotice- Don't display copyright notice
Keyboard Shortcuts and Commands
File Operations
Ctrl+K H # Get help (display help screen)
Ctrl+K X # Exit and save all files
Ctrl+K D # Save current file
Ctrl+K Q # Quit without saving
Ctrl+K E # Edit another file
Ctrl+K R # Insert file contents
Ctrl+K V # Move to next file/buffer
Ctrl+K U # Move to previous file/buffer
Ctrl+K G # Goto specific buffer by number
Ctrl+K O # Save file with different name
Ctrl+K N # Toggle line numbers
Ctrl+K Z # Suspend editor (return to shell)
Cursor Movement
# Basic movement
Ctrl+F # Move forward one character
Ctrl+B # Move backward one character
Ctrl+P # Move to previous line
Ctrl+N # Move to next line
Ctrl+A # Move to beginning of line
Ctrl+E # Move to end of line
# Advanced movement
Ctrl+U A # Beginning of buffer
Ctrl+U E # End of buffer
Ctrl+U P # Previous page
Ctrl+U N # Next page
Ctrl+U I # Go to specific line
Ctrl+U L # Go to column
# Word movement
Ctrl+U B # Previous word
Ctrl+U F # Next word
# Screen movement
Ctrl+U T # Scroll down one line
Ctrl+U C # Scroll up one line
Text Editing and Deletion
# Character operations
Ctrl+D # Delete character at cursor
Ctrl+H # Delete character before cursor (backspace)
Ctrl+G # Delete character at cursor and open line
# Word operations
Ctrl+W # Delete word to left
Ctrl+O # Delete word to right
# Line operations
Ctrl+Y # Delete line
Ctrl+T # Delete to end of line
Ctrl+@ # Set mark (begin selection)
Block Operations
Ctrl+K B # Mark beginning of block
Ctrl+K K # Mark end of block
Ctrl+K C # Copy block
Ctrl+K M # Move block
Ctrl+K Y # Delete block
Ctrl+K W # Save block to file
Ctrl+K R # Read file into block
Ctrl+K X # Exchange mark and cursor
Ctrl+K L # Left justify block
Ctrl+K R # Right justify block
Ctrl+K ; # Execute shell command on block
Search and Replace
Ctrl+K F # Find text
Ctrl+L # Repeat last find
Ctrl+K R # Replace text
Ctrl+K A # Replace all
Ctrl+K B # Find backward
Ctrl+K N # Find next occurrence
# Search options during search
Alt+C # Toggle case sensitivity
Alt+R # Toggle regular expressions
Alt+W # Toggle word search
Formatting and Special Operations
Ctrl+K J # Format paragraph
Ctrl+K Space# Center line
Ctrl+K , # Insert date/time
Ctrl+K . # Insert file name
Ctrl+K / # Spell check
Ctrl+K ; # Execute shell command
Ctrl+K I # Indent block
Ctrl+K U # Unindent block
Ctrl+K = # Get character code
Macro Operations
Ctrl+K ( # Start recording macro
Ctrl+K ) # Stop recording macro
Ctrl+K ' # Execute last macro
Ctrl+K M # Execute numbered macro
Buffer and Window Management
Ctrl+K 0-9 # Switch to buffer 0-9
Ctrl+K V # Next buffer
Ctrl+K U # Previous buffer
Ctrl+K G # Goto specific buffer
Ctrl+K E # Edit file in new buffer
Ctrl+K X # Split screen (if supported)
Usage Examples
Basic Text Editing
Simple File Creation and Editing
# Create new file
joe new_document.txt
# Edit existing file
joe existing_file.txt
# Start at specific line
joe +25 config_file.conf
# Edit with auto-indentation
joe --autoindent source_code.c
# Edit with specific tab width
joe --tab 4 python_script.py
# Edit with line numbers
joe --linums program.c
# Edit with custom screen dimensions
joe --columns 120 --lines 40 wide_document.txt
Quick Text Operations
# Edit file and immediately save
joe --autoindent --backups important_config.conf
# Edit without creating backup files
joe --nobackups temp_file.txt
# Force newline at end of file
joe --force script.sh
# Edit with tab conversion to spaces
joe --notab --tab 2 yaml_config.yml
Programming and Development
Source Code Editing
# Edit C source with programming-friendly settings
joe --autoindent --notab --tab 4 --backups program.c
# Edit Python with proper indentation
joe --autoindent --notab --tab 4 --linums python_module.py
# Edit JavaScript with modern settings
joe --autoindent --spaces --tab 2 --columns 100 app.js
# Edit HTML with syntax-appropriate settings
joe --tab 2 --autoindent webpage.html
# Edit shell script with executable permissions preserved
joe --autoindent --backups script.sh
Code Development Workflow
# Multiple file editing for project
joe main.c utils.h functions.c
# Within Joe:
Ctrl+K B # Mark beginning of function
Navigate to function end
Ctrl+K K # Mark end of function
Ctrl+K C # Copy function
Navigate to new location
Ctrl+K M # Move function
# Search for function definitions
Ctrl+K F # Find "function_name"
Alt+R # Enable regular expressions
int\(\w+\) # Search for function definitions
# Replace variable name throughout file
Ctrl+K A # Replace all
"old_var" # Search string
"new_var" # Replacement string
Code Review and Comparison
# Open multiple files for code review
joe original.c modified.c
# Navigate between files
Ctrl+K V # Next file
Ctrl+K U # Previous file
# Use block operations for comparison
Ctrl+K B # Mark block in first file
Switch to second file
Ctrl+K C # Copy for comparison
System Administration
Configuration File Management
# Edit system configuration with backups
sudo joe --backups /etc/ssh/sshd_config
# Edit without backups to avoid clutter
sudo joe --nobackups /tmp/test_config
# Edit with forced newline for shell scripts
joe --force /etc/profile.d/custom.sh
# Edit with specific tab width for configuration
joe --tab 2 --autoindent /etc/nginx/nginx.conf
Log File Analysis
# Edit large log files efficiently
joe --skiptop 5 --nolinums /var/log/syslog
# Edit with search capabilities
joe --columns 120 access.log
# Within Joe for log analysis:
Ctrl+K F # Find "ERROR"
Alt+C # Case sensitive search
Ctrl+K N # Find next error
Ctrl+K B # Mark beginning of error section
Ctrl+K K # Mark end
Ctrl+K W # Save error section to file
System Scripts Editing
# Edit system startup scripts
sudo joe --autoindent --backups /etc/rc.local
# Edit cron table
EDITOR=joe crontab -e
# Edit with proper line endings
joe --crlf windows_script.bat
# Edit with file locking disabled
joe --nolocks shared_file.txt
Document Writing and Text Processing
Technical Documentation
# Edit with document-friendly settings
joe --columns 80 --autoindent --tab 4 README.md
# Edit with context lines for better navigation
joe --context 3 technical_document.txt
# Edit with custom screen layout
joe --columns 72 --skiptop 3 manuscript.txt
# Edit with date insertion capability
joe --autoindent journal.txt
Email and Communication
# Compose email with proper formatting
joe --columns 72 email_draft.txt
# Use WordStar emulation for email
joe --wordstar message.txt
# Insert date and time in document
# Within Joe:
Ctrl+K , # Insert current date/time
Advanced Features
Regular Expression Search
Pattern Matching
# Enable regex search
Ctrl+K F # Find dialog
Alt+R # Toggle regular expressions
# Common regex patterns
^start # Lines beginning with "start"
end$ # Lines ending with "end"
int\(\w+\) # Function definitions
#include\s*<[^>]+> # Include directives
\d+\.\d+\.\d+\.\d+ # IP addresses
Advanced Search Operations
# Search and replace with regex
Ctrl+K A # Replace all
Alt+R # Enable regex
(\w+)=(.*) # Search for key=value pairs
\1=\2 # Preserve format in replacement
# Word search
Alt+W # Toggle word search
error # Search for whole word "error" only
Macro Recording and Automation
Creating Macros
# Record a sequence of operations
Ctrl+K ( # Start recording
Perform editing actions:
Ctrl+K B # Mark beginning
Navigate to end
Ctrl+K K # Mark end
Ctrl+K C # Copy
Navigate to new location
Ctrl+K M # Move
Ctrl+K ) # Stop recording
# Execute the recorded macro
Ctrl+K ' # Replay last recorded macro
Advanced Macro Usage
# Numbered macros for multiple sequences
Ctrl+K 1 # Execute macro 1
Ctrl+K 2 # Execute macro 2
# ... up to macro 9
# Create macros for common tasks:
# Macro 1: Comment block
Ctrl+K (
Ctrl+K B # Mark beginning
Navigate to end of block
Ctrl+K K # Mark end
Ctrl+K C # Copy block
Type "# " before each line
Ctrl+K ) # Stop recording
Block and Column Editing
Rectangular Selection
# Create rectangular block
Ctrl+K X # Exchange mark and cursor
Set top-left corner
Navigate to bottom-right
Ctrl+K K # Mark end
# Rectangle operations
Ctrl+K C # Copy rectangle
Ctrl+K M # Move rectangle
Ctrl+K Y # Delete rectangle
Advanced Block Operations
# Multi-file block operations
Ctrl+K B # Mark block in file1
Ctrl+K W # Save block to temp.txt
Switch to file2
Ctrl+K R # Read temp.txt
# Block justification
Ctrl+K L # Left justify block
Ctrl+K R # Right justify block
Shell Integration
Command Execution
# Execute shell command within editor
Ctrl+K ; # Execute shell command
Enter: ls -la
# Insert command output
Ctrl+K R # Read file
Enter: !date
# Pipe block through command
Ctrl+K B # Mark block
Ctrl+K ; # Execute shell command
Enter: sort
External Tool Integration
# Use external spell checker
Ctrl+K / # Spell check (if configured)
# Format code with external formatter
Ctrl+K B # Mark block
Ctrl+K ; # Execute command
Enter: !clang-format
# Compile and view errors
Ctrl+K ; # Execute command
Enter: !gcc -Wall program.c 2>&1 | joe -
Configuration and Customization
Configuration Files
Hierarchy of Configuration Files
# System-wide configuration
/etc/joe/joerc
/etc/joe/joerc.html
/etc/joe/syntax/
# User configuration (in order of precedence)
~/.joerc
~/.joerc.html
./.joerc
./.joerc.html
Sample Configuration File
# ~/.joerc - Sample Joe configuration
# Basic editor settings
-autoindent
-spaces
-tab 4
-linums
-backups
-keepup
# Display settings
-columns 80
-context 3
-mouse
# Search settings
-searchcase
-regex
# File handling
-asis
-force
-nolocks
# Syntax highlighting
-syntax javascript
-syntax python
-syntax c
# Custom key bindings
defmap joe
^KH "Help"
^KX "Save and exit"
^KQ "Quit without saving"
^K^W "Delete word left"
^K^O "Delete word right"
# File type associations
"*\.c$" -syntax c
"*\.h$" -syntax c
"*\.py$" -syntax python
"*\.js$" -syntax javascript
"*\.html$" -syntax html
Syntax Highlighting Configuration
Custom Syntax Definitions
# ~/.joerc syntax section
# Python syntax highlighting
:deflang python
:highlighting
:regex "^\\s*#.*$" comment
:regex "\b(def|class|if|else|elif|for|while|try|except|finally|import|from|return|yield|break|continue|pass|raise|with|as|lambda|global|nonlocal)\b" keyword
:regex "\"(?:[^\"\\]|\\.)*\"" string
:regex "'(?:[^'\\]|\\.)*'" string
:regex "\b\d+\b" number
:regex "\b(True|False|None)\b" constant
# JavaScript syntax highlighting
:deflang javascript
:highlighting
:regex "//.*$" comment
:regex "/\*.*?\*/" comment
:regex "\b(var|let|const|function|if|else|for|while|do|switch|case|break|continue|return|try|catch|finally|throw|new|this|typeof|instanceof|in|of|class|extends|import|export|default|async|await)\b" keyword
:regex "\"(?:[^\"\\]|\\.)*\"" string
:regex "'(?:[^'\\]|\\.)*'" string
:regex "\b\d+(\.\d+)?\b" number
Custom Key Bindings and Macros
Advanced Customization
# Custom key bindings in .joerc
defmap joe
# Function key definitions
^F1 "Toggle line numbers"
^K^N "Toggle line numbers"
^F2 "Save file"
^KD "Save file"
^F3 "Open file"
^KE "Edit another file"
^F4 "Search"
^KF "Find text"
^F5 "Replace"
^KR "Replace text"
^F6 "Mark block"
^KB "Mark beginning"
^F7 "Copy block"
^KC "Copy block"
^F8 "Paste"
^KV "Move to next buffer"
# Custom macros
^K( "Start macro recording"
^K) "Stop macro recording"
^K' "Execute macro"
# Custom functions
^K^T "Insert timestamp"
^K^D "Insert date"
^K^F "Format paragraph"
^K^J "Justify paragraph"
^K^C "Center line"
Practical Examples
Programming Project Development
Complete Development Workflow
# Start Joe with project files
joe --autoindent --notab --tab 4 --backups --linums main.c utils.h
# File navigation and editing:
Ctrl+K B # Mark function beginning
Ctrl+K K # Mark function end
Ctrl+K C # Copy function to new location
# Search for function references:
Ctrl+K F # Find function_name
Alt+R # Enable regex
\w+\s*\( # Find function calls
# Multi-file operations:
Ctrl+K E # Edit header file
Ctrl+K V # Switch between files
Ctrl+K G 2 # Go to buffer 2
# Code formatting:
Ctrl+K I # Indent selected block
Ctrl+K U # Unindent selected block
Code Refactoring Example
# Within Joe, refactor variable names:
# 1. Find all occurrences
Ctrl+K F # Find dialog
"old_var" # Search term
Alt+C # Case sensitive
Ctrl+K N # Find next
# 2. Replace with confirmation
Ctrl+K R # Replace dialog
"old_var" # Search term
"new_var" # Replacement
Confirm each replacement
# 3. Global replacement
Ctrl+K A # Replace all
"old_var" # Search
"new_var" # Replacement
Documentation Writing
Technical Manual Creation
# Start with document-friendly settings
joe --columns 72 --autoindent --tab 2 --skiptop 3 manual.md
# Document structure editing:
Ctrl+K , # Insert current date/time for version info
Ctrl+K Space# Center title lines
# Paragraph formatting:
Ctrl+K J # Format paragraph
Ctrl+K I # Indent for lists
# Cross-references and links:
Ctrl+K F # Find section headers
[Chapter 2] # Add reference
System Administration
Configuration Management
# Edit system configuration safely
sudo joe --backups --autoindent /etc/apache2/sites-available/000-default.conf
# Template creation:
joe --autoindent --notab --tab 4 config_template.conf
# Within Joe:
Ctrl+K , # Insert date as modification time
Ctrl+K . # Insert filename for documentation
Ctrl+K W # Save specific configuration sections
Log Analysis Workflow
# Analyze large log files
joe --nolinums --context 2 /var/log/apache2/error.log
# Search and extract error patterns:
Ctrl+K F # Find "error"
Alt+C # Case sensitive
Ctrl+K B # Mark error beginning
Navigate to error end
Ctrl+K K # Mark error end
Ctrl+K W # Save error section to file
# Filter specific error types:
Ctrl+K F # Find
"404" # Search for 404 errors
Ctrl+K B # Mark start
Ctrl+K K # Mark end
Ctrl+K C # Copy to buffer
Ctrl+K E # Create new buffer
Ctrl+K V # Paste for analysis
Integration and Automation
Shell Script Integration
Automated Editing Scripts
#!/bin/bash
# Automated file processing with Joe
# Process configuration files
for file in *.conf; do
joe --autoindent --tab 2 --nobackups "$file" <<EOF
^KF # Find specific setting
^KI # Insert new configuration
^KX # Save and exit
EOF
done
# Batch header file processing
for header in *.h; do
joe --autoindent "$header" <<JOE_COMMANDS
^KF # Find copyright notice
^K, # Insert current date
^KX # Save and exit
JOE_COMMANDS
done
Version Control Integration
# Set Joe as default editor for Git
export EDITOR="joe --autoindent --notab --tab 4"
export GIT_EDITOR=$EDITOR
# Git commit workflow
git commit # Opens Joe for commit message
# Git rebase with Joe
git rebase -i # Uses Joe for interactive rebase
# Git config with Joe
git config --edit # Opens .gitconfig in Joe
Development Environment Setup
IDE-like Configuration
# Create project-specific Joe configuration
cat > project.joerc << 'EOF'
# Project-specific Joe configuration
-autoindent
-spaces
-tab 4
-linums
-backups
-columns 100
-syntax c
-syntax python
-syntax javascript
# Custom key bindings for project
defmap joe
^F1 "Run make"
^K^M "Execute: make clean && make"
^F2 "Run tests"
^K^T "Execute: make test"
EOF
# Use project configuration
JOERC=./project.joerc joe main.c
Make Integration
# Makefile target to open Joe for editing
edit:
joe --autoindent --notab --tab 4 $(FILES)
# Edit specific file types
edit-c:
joe --autoindent --notab --tab 4 --syntax c $(SRC)
edit-python:
joe --autoindent --spaces --tab 4 --syntax python $(PY_SRC)
Performance Tips and Optimization
Large File Handling
Memory-Efficient Editing
# Edit large files with minimal overhead
joe --nolinums --skiptop 10 huge_file.txt
# Disable features for better performance
joe --nobackups --nolocks --lightoff large_log.txt
# Use context mode for better navigation
joe --context 5 --columns 120 wide_document.txt
Search Performance
# Use case-sensitive search for faster matching
Ctrl+K F # Find dialog
Alt+C # Enable case sensitivity
# Use word search for precision
Alt+W # Enable word search
# Limit search scope with block selection
Ctrl+K B # Mark block start
Ctrl+K K # Mark block end
Ctrl+K F # Search within block only
System Resource Management
Memory Optimization
# Reduce memory usage for large files
joe --nobackups --noexask large_file.txt
# Disable unnecessary features
joe --nosta --lightoff --beep intensive_processing.txt
# Use minimal configuration
joe --columns 80 --lines 24 minimal_edit.txt
CPU Optimization
# Disable real-time features for faster editing
joe --lightoff --keepup performance_sensitive.txt
# Use simple key bindings
joe --nonotice --noxon fast_edit.txt
Troubleshooting
Common Issues and Solutions
File Permission Problems
# Permission denied when editing system files
sudo joe /etc/sudoers
# File locking issues
joe --nolocks shared_file.txt
# Backup file clutter
joe --nobackups temporary_file.txt
Display and Terminal Issues
# Terminal doesn't support mouse
joe --nomouse file.txt
# Display problems on small terminals
joe --columns 80 --lines 24 file.txt
# Flow control issues
joe --noxon file.txt
Configuration Problems
# Reset to default configuration
joe --noexask file.txt
# Use minimal configuration
joe --nosta --nonotice file.txt
# Debug configuration issues
joe --help
Performance Issues
# Slow editing of large files
joe --skiptop 10 --nolinums large_file.txt
# Memory exhaustion with huge files
joe --nobackups --nolocks --lightoff huge_file.txt
# System freeze during complex operations
joe --noexask --keepup problematic_file.txt
Related Commands
emacs- GNU Emacs editor (can be emulated)vi- Visual editorvim- Vi IMprovednano- Nano editorjed- JED editor (similar capabilities)pico- Pine composered- Line-oriented editorsed- Stream editor for batch processingawk- Pattern scanning and processing
Best Practices
- Enable auto-indentation for programming with
--autoindent - Use spaces instead of tabs for better cross-platform compatibility
- Enable backups for important files with
--backups - Configure tab settings appropriately for different file types
- Learn block operations for efficient text manipulation
- Use keyboard shortcuts extensively for speed
- Customize .joerc for personalized workflow
- Enable line numbers for code editing with
--linums - Use search and replace effectively for bulk changes
- Learn editor emulations if coming from other editors
- Save frequently to prevent data loss
- Use version control integration for code management
- Configure syntax highlighting for better code readability
- Use macros for repetitive editing tasks
- Master regular expressions for powerful search operations
Performance Tips
- Disable unnecessary features for large files (
--nolinums,--nobackups) - Use case-sensitive search for faster pattern matching
- Limit context lines for better performance (
--context 2) - Use rectangular blocks for column-based editing
- Record macros for repetitive operations
- Use appropriate tab settings to avoid mixed indentation
- Enable mouse support for faster navigation when available
- Use multiple buffers for working with several files
- Configure syntax highlighting only for relevant file types
- Use shell integration for external tool integration
Joe's Own Editor provides an excellent balance between simplicity and power. Its ability to emulate other popular editors makes it accessible to users transitioning from different environments, while its native features provide efficient text editing capabilities. The intuitive keyboard shortcuts, comprehensive help system, and extensive customization options make it suitable for both beginners and experienced users who need a reliable, full-screen text editor for programming, system administration, and document writing tasks.