# "ps -aux | grep <something>" get whole line



## da1 (Nov 29, 2011)

Hi guys,

Maybe a newbie question but my "problem" is that while on a FreeBSD terminal (xfce4), when I grep for a process (via *ps -aux | grep <proc>*) I only get the max. number of characters my terminal can display horizontally. Is there a way to get he whole line ?

Example:

```
[da1@catedral.ro 1:23pm] ~/>ps -aux | grep mysql
mysql     1955  0.0  0.0  8344   800  ??  Is   18Nov11   0:00.02 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-fil
```


----------



## SirDice (Nov 29, 2011)

ps(1)

[cmd=]ps -auwwx[/cmd]

Consider using pgrep(1) instead of *ps -aux | grep someprocess*.


----------



## da1 (Nov 29, 2011)

Damn... and I was just reading about the "w" option. Ow well ... one learns as long as one lives .

Thx SirDice.


----------



## phoenix (Nov 30, 2011)

`# pgrep -lf <something in the command-line>`
`# pgrep -lf mysql`

See the man page for more info:  pgrep(1)

There's also pkill(1).  Between those, "ps | grep" constructs are no longer needed.


----------



## da1 (Dec 1, 2011)

phoenix, thx


----------

