I have 64 processes running that have the following string
pbs_mom -m -M 1234 -R 5678 -A foo12345 -c /var/spool/torque/mom_priv/login_config
I need to search and extract just foo12345
- always starts with 3 lowercase letters
- followed by 5 digits
Here is what I am trying but I am getting the entire line in return
ps aux |grep foo| grep 'foo[0-9]\+'
How can I strip off all text except foo12345.