Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rtulke/rp
rp aka red pencil is a simple multicolor command-line tool to highlight the filtered output text.
https://github.com/rtulke/rp
color command-line command-line-tool egrep grep highlight mark pencil python rp rpen select text
Last synced: 2 months ago
JSON representation
rp aka red pencil is a simple multicolor command-line tool to highlight the filtered output text.
- Host: GitHub
- URL: https://github.com/rtulke/rp
- Owner: rtulke
- License: gpl-2.0
- Created: 2014-05-06T00:19:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-15T17:28:42.000Z (8 months ago)
- Last Synced: 2024-05-16T05:56:30.382Z (8 months ago)
- Topics: color, command-line, command-line-tool, egrep, grep, highlight, mark, pencil, python, rp, rpen, select, text
- Language: Python
- Homepage:
- Size: 188 KB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rp
==rp - red pencil is a simple multicolor command-line tool to highlight the filtered output text.
I always had problems with filtering out large continuous text, i.e. text that you want to filter out of log files with cat or something similar. So I needed a tool that makes it easy to see what I'm actually looking for.
![Example](/images/rpen1.png)
Requirements
------------* Python 2.5x, 2.7x or Python 3.x
* egrep or grep, grep should be GNU Version 3.xSetup Linux
-----------```bash
git clone https://github.com/rtulke/rp.git
cp rp/rp.py /usr/local/bin/rp
chmod 777 /usr/local/bin/rp
```Setup MacOS X
-------------Mac OS X uses the BSD grep or egrep which is not 100% compatible with Linux grep/egrep. Therefore it requires an additional -e "OK" which must be used directly in the code.
Otherwise you will get this error message: "egrep: empty (sub)expression"
Usage
-----```
$ rp
Usage: cat logfile | rp [options] searchterm1 searchterm2...Options:
-h, --help show this help message and exit
-i perform a case insensitive search
-k only highlight, do not filter
````Examples
--------```bash
cat /foo/bar | rp searchstring1 searchstring2 ..
```or try less with RAW mode:
```bash
cat /foo/bar | rp searchstring1 searchstring2 .. | less -R
```rp with regex:
```bash
cat /foo/bar | rp ^.*[04]
```highlight whole line:
```bash
cat /foo/bar | rp ^.\*searchstring\*.$
``````bash
cat /foo/bar | rp -i Searchstring1 searchString2 .. | less -R
```