Question:
What does cat /etc/passwd | awk -F":" '{print $1}' | sort >> ~/users 2>&1 mean?
1970-01-01 00:00:00 UTC
What does cat /etc/passwd | awk -F":" '{print $1}' | sort >> ~/users 2>&1 mean?
Three answers:
2016-10-22 12:04:46 UTC
<(^__^)> hi!i!i!i!i!i!i!i!i!i!i!i (>^-^)> So about my question... ~~~ Do you style of ever decide someone by ability of the Avatar they have? yet no longer those with genuine Y! Avatars, I recommend like Anime, Random Avatars style of. I also do not recommend that you opt them in a nasty way, yet basically by ability of searching at their Avatar percentyou may assume them to act or be a particular way. -Yeah, each so often. I photo them as their avatar, yet, lots of the time, i am going to tell what gender they are. So, you as Boa yet male, that's likely extra like a demanding woman pirate with an really deep voice yet relaxing in a mode of way. (You ruined Boa's photo.) -basically kidding. in any case, what I recommend is, I decide human beings by ability of how they answer the question. ... (>^.^)> get together: you note an Avatar with a sensible Anime personality, so that you assume them to be smart for some motives of their solutions and questions. or you note someone with a loopy personality and also you assume them to be...properly, loopy! Or someone with a warm Avatar Anime personality, humorous Anime personality, reliable Anime personality. Or in case you note someone with an Anime personality that you imagine is wonderful, you immediately like that man or woman with that avatar... +++ What do you imagine of folk once you note their Avatars? +++ -do not recognize. I basically see them as any random man or woman, i wager <(0-o)> What about Names? ... -it relies upon in the journey that they post a real call or their username === Random Anime Questinons === (>^.^)>[a million] call some Anime Characters that are Giants!? -Gidanbo (Bleach) (>^.^)>[2] Which Anime Characters from ANY Anime may you in no way enable them arise with a lack of life note!? Why? -I say Monkey D. Luffy because he may rip it to shreds or by danger write his call in like a own diary. <>===<>===<>===<>===<>===<>===<>===<> d-(^__~)> Thumbs UP! Thnx for Answering! -useful Byezzz -bye
potatocouch
2012-04-24 17:37:57 UTC
you should try it! that's how you learn.



cat /etc/passwd ... you should know this



awk -F":" '{ print $1 }' ... whatever was passed from the above will be split into fields. how do you know what was passed? see RoseD's answer. the F means field delimited by, ie the partitioning character and the $1 means the first field. so basically everything from the beginning of each line up to the first colon (:)



sort ... you should know this



>> ~/users ... result of the command above will be appended to a file called users



2>&1 ... stdout which is what you see on the screen is 1. stderr which is what you see on the screen when something isn't right, eg syntax errors, is 2. from the above command you know that all that cat, awk, sort will be redirected to that users file. this means your stdout is going to that file. next, 2, which are any errors from all those commands will be redirected to &1, which means wherever 1 (stdout) is going. in a nutshell, all those commands AND any errors will go to that file.



this stumped me before, why not use 2>1 then? because that means the errors will go into a file named "1".
Rose D
2012-04-23 17:04:25 UTC
You can see the structure of /etc/passwd at http://en.wikipedia.org/wiki/Passwd_(file) which should make this clearer.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...