Kushal Das

FOSS and life. Kushal Das talks here.

pss in Fedora

We have pss packaged in Fedora.

pss is a tool for searching in source code or text files. It searches recursively in the directory structure. By default it skips directories like .svn or .git.

Example: Searching tok_new in the C source files.

$  pss tok_new --cc
./Parser/tokenizer.c
43:static struct tok_state *tok_new(void);
113:tok_new(void)
768:    struct tok_state *tok = tok_new();
785:    struct tok_state *tok = tok_new();
816:    struct tok_state *tok = tok_new();

In the same way to search in only python files use --python option.

$ pss enqueue --python
./tests.py
41:        self.assertTrue(queue.enqueue(t))
57:        queue.enqueue(t)

./examples/async_producer.py
8:job = queue.enqueue(task1)

./examples/sync_producer.py
7:job = queue.enqueue(task1)

./examples/producer.py
9:queue.enqueue(task1)
10:queue.enqueue(task2)

./retask/queue.py
183:    def enqueue(self, task):
203:           >>> job = q.enqueue(task)

To know different available options one can pass -h or --help to pss and view all options.

Install it using yum

# yum install pss
comments powered by Disqus