Linux command
urlscan 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Extract URLs from email
urlscan < [email.txt]
Pipe content to urlscan
cat [file.txt] | urlscan
Compact list view
urlscan -c < [email.txt]
Print URLs without browser
urlscan -n < [email.txt]
Remove duplicate URLs
urlscan -d < [email.txt]
Run custom command on URL
urlscan --run "[wget {}]" < [email.txt]
Generate config file
urlscan --genconf
说明
urlscan extracts and displays URLs from email messages or text files in an interactive terminal interface. It is primarily designed for use with mutt and other terminal mail clients. The tool parses input for URLs and presents them in a navigable list with surrounding context. URLs can be opened in a browser, copied to clipboard, or passed to custom commands. Configuration is stored in ~/.config/urlscan/config.json. Custom URL patterns can be defined with --regex for specialized extraction.
参数
- -c, --compact
- Display simple list without context.
- -d, --dedupe
- Remove duplicate URLs.
- -n, --no-browser
- Print URLs to stdout, no interactive mode.
- -r, --run _command_
- Run command with URL as argument (use {} placeholder).
- -f, --run-safe _command_
- Safely run command with URL.
- -p, --pipe
- Pipe URL to command instead of argument.
- -R, --reverse
- Reverse displayed order.
- -s, --single
- Exit after opening one URL.
- -w, --width _n_
- Set display width.
- -W, --whitespace-off
- Condense display output.
- -H, --nohelp
- Start with help header hidden.
- -g, --genconf
- Generate default config file.
- -E, --regex _pattern_
- Custom regex for URL extraction.
FAQ
What is the urlscan command used for?
urlscan extracts and displays URLs from email messages or text files in an interactive terminal interface. It is primarily designed for use with mutt and other terminal mail clients. The tool parses input for URLs and presents them in a navigable list with surrounding context. URLs can be opened in a browser, copied to clipboard, or passed to custom commands. Configuration is stored in ~/.config/urlscan/config.json. Custom URL patterns can be defined with --regex for specialized extraction.
How do I run a basic urlscan example?
Run `urlscan < [email.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --compact do in urlscan?
Display simple list without context.