I'm redirecting results for something into a file and I also need to find the process name and ID number and redirect it to the file as well. I'm guessing the process name is the command in which I'm directing the results to. As in if the command is pgrep sshd and I redirect the results to the file, pgrep sshd would be the process name. I'm just curious though how exactly I find the process ID number and what would be the simplest way to redirect it to a file if there is a command to find it.Here is the original objective I was given, I'm sorry if I seem really new at this, I am a student.Man pages usually have a helpful section near the end called SEE ALSO that you can use to find a list of commands and topics related to the command that the current man page is about.  Use this feature to locate a command related to ps that will search for processes based on some criteria.  Use this command to locate all processes called sshd, directing the output to a file named processes.txt in ~/sysadmin1, making sure that the command also prints out the process name next to the process ID number. You will have to specify a flag with the command that you find in the man page for the command in order to do this. When you have finished add the full command used to the top of the processes.txt file.
How do I print the process name next to the process ID number in a file?
process;ps
I opened a shell and typed man ps and then foudn the SEE ALSO section.  Here's what it is on my Mint 14 system:SEE ALSO       pgrep(1), pstree(1), top(1), proc(5).Your instructions say to pick one of those and use it to list all the processes named sshd.  In this case, pgrep is your friend.  Read the man page for pgrep (man pgrep) to learn how to make pgrep spit out the process name along with the PID for the sshd processes.On my system, I see that the -l option will do it:$ pgrep -l sshd10247 sshd