Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing output of pwck

SOLVED
Go to solution
Brian Atkins
Advisor

Viewing output of pwck

Is there a method of saving the output of pwck to a file for later review? I have attempted to '>', '>>' and '-&1>'.
4 REPLIES
Solution

Re: Viewing output of pwck

Hi Brian!

Try this

# pwck 2>file_name

to save the output.

Bye
Brian Atkins
Advisor

Re: Viewing output of pwck

Worked great! Thanks!
Kofi ARTHIABAH
Honored Contributor

Re: Viewing output of pwck

outputs from pwck are sent to stderr (file descriptor 2) so you would have to redirect 2 to the stdout (which can be redirected to your logfile)

eg. # pwck > logfile 2>&1
nothing wrong with me that a few lines of code cannot fix!
f. halili
Trusted Contributor

Re: Viewing output of pwck

1 ) You may use this command:
# pwck 2>&1 | tee -a outfile

nobody:*:-2:-24::/:
Invalid GID
2) check your output file, note error also appears in your screen.
# more outfile

nobody:*:-2:-24::/:
Invalid GID