-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start Guide
This guide covers the essentials to start using Clean BOM Senior right now.
- Linux, macOS, or WSL (Windows Subsystem for Linux)
- Bash shell (v4.0 or newer)
- Basic command-line knowledge
- Read/write permissions on target files
Windows users: Use WSL or Git Bash for native support.
Use the published npm package to install the global bom command:
npm install -g clean-bom-senior
bom --helpThis is the fastest option if you already use Node.js and npm on your machine.
Get the latest version from the GitHub repository:
# Clone the repository
git clone https://github.com/paulmann/Clean_BOM_Senior.git
cd Clean_BOM_Senior
# Or download just the script
curl -O https://raw.githubusercontent.com/paulmann/Clean_BOM_Senior/main/clean-bom-senior.sh
# Make it executable
chmod +x clean-bom-senior.shBefore making changes, preview what will be done:
# Dry-run: See what will change without modifying anything
./clean-bom-senior.sh --dry-run /path/to/your/filesIf you installed via npm, you can use the global command instead:
bom --dry-run /path/to/your/filesBefore making changes, preview what will be done:
# Dry-run: See what will change without modifying anything
./clean-bom-senior.sh --dry-run /path/to/your/filesOutput example:
[DRY-RUN] Scanning: /path/to/your/files
[BOM DETECTED] file1.txt (UTF-8 BOM)
[BOM DETECTED] file2.php (UTF-8 BOM)
[NO CHANGES] file3.md
Total files processed: 3
Files to be cleaned: 2
Once you're confident about the changes:
# Clean BOM from all files
./clean-bom-senior.sh /path/to/your/filesFor a single directory with all subdirectories:
# This is the most common use case
./clean-bom-senior.sh ~/my-projectCheck what was cleaned:
# Show detailed report
./clean-bom-senior.sh --verbose /path/to/your/filesOutput includes:
- Files processed
- BOM types detected
- Encoding changes made
- Files skipped and why
# Clean all files in current directory
./clean-bom-senior.sh .
# Clean a project directory
./clean-bom-senior.sh ~/my-website
# Clean a nested project
./clean-bom-senior.sh /var/www/htmlKeep original files with .bak extension:
./clean-bom-senior.sh --backup /path/to/filesThis creates:
original.txt
original.txt.bak β backup copy
Process only PHP files:
./clean-bom-senior.sh --file-type php /path/to/project./clean-bom-senior.sh --exclude node_modules,vendor /path/to/project./clean-bom-senior.sh --file-type text /path/to/projectThe script automatically detects and processes:
- Code Files: PHP, Python, JavaScript, Java, C/C++, Go, Rust
- Markup: HTML, XML, JSON, YAML, TOML
- Data: CSV, TSV, SQL, SRT
- Config: .htaccess, .conf, .ini, .env
- Styles: CSS, SCSS, LESS
- Templates: Blade, Twig, Mustache
- Text: Plain text, Markdown, RST
For complete list, see File Types and Detection.
Before you start, make sure:
- You have read/write permissions on the directory
- You have a backup (optional but recommended)
- You tested with
--dry-runfirst - You understand which files will be affected
After cleaning:
- Check files open correctly in your editor
- Verify no encoding issues in version control
- Test your application/website
- Confirm Git no longer flags encoding problems
What if nothing happens?
β Try with --verbose flag to see details
Worried about breaking something?
β Use --backup to keep originals, or --dry-run first
Want to undo changes?
β Restore from Git: git checkout -- . or restore .bak files
Specific file type causing issues?
β Check File Types and Detection
Still stuck?
β Visit Troubleshooting Guide or FAQ
| Option | Purpose | Example |
|---|---|---|
--dry-run |
Preview changes without modifying | --dry-run /path |
--backup |
Create .bak backup files |
--backup /path |
--verbose |
Show detailed report | --verbose /path |
--file-type |
Process only specific type | --file-type php /path |
--exclude |
Skip directories | --exclude vendor,node_modules /path |
--fix-gitattributes |
Update .gitattributes
|
--fix-gitattributes |
For complete reference: Command-Line Reference
Want to understand more?
β Read Understanding BOM and CRLF
Need all command details?
β Check Command-Line Reference
Integrating with CI/CD?
β See CI/CD Integration Guide
Troubleshooting an issue?
β Visit Troubleshooting Guide
-
Always dry-run first - Use
--dry-runbefore making changes -
Use backups for safety - Add
--backupwhen first learning - Combine with version control - Work in a Git branch for easy rollback
- Schedule for regular use - Add to CI/CD pipeline for automation
-
Monitor output - Use
--verboseto see exactly what changed
You're all set! Start with step 1 and you'll be cleaning BOM artifacts in minutes.