
March 9th, 2006, 07:16 PM
|
 |
Not a clue what to put ...
|
|
Join Date: Jan 2006
Location: in front of this keyboard
|
|
|
Simple answer is something of the order of:
command /etc/passwd > /your/output.file
That, obvioulsy makes no sense - it all depends on what line, how you want to find it, or them. If, for example you want to copy the line for the user "spezialize" then you would use:
grep spezialize /etc/passwd > /your/output.file
Except, of course, that may not do exactly what you wish - it would copy every line that contained spezialize into the output file. A look at the man pages will soon allow you to do something like:
grep "^spezialize:" /etc/passwd > /your/output.file
Which would ONLY copy any line in the /etc/passwd file that started with (denoted by the ^) the string spezialize: - the : is used at the end of the strinf as that i sused in the passwd file as a field delimiter - this we are saying only copy to the output file the line in the file that relates to the user spezialize (since we know that the username field is the first in the file).
Getting different lines out, depending on what you are looking for would 'just' need a different search string in a grep command and/or further processing - all of which would come down to what you are after.
|