Sort with field separator [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
This question already has an answer here:
Two files with a common field - is it possible to sort one based on the other?
3 answers
I'm trying to sort the /etc/passwd
numerically by user id numbersb(third field) in ascending order and then send it to s4.
What command would I uses to do that? I'm on this for a while now.
linux sort
New contributor
marked as duplicate by Jeff Schaller, Goro, RalfFriedl, Thomas, GAD3R 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
-1
down vote
favorite
This question already has an answer here:
Two files with a common field - is it possible to sort one based on the other?
3 answers
I'm trying to sort the /etc/passwd
numerically by user id numbersb(third field) in ascending order and then send it to s4.
What command would I uses to do that? I'm on this for a while now.
linux sort
New contributor
marked as duplicate by Jeff Schaller, Goro, RalfFriedl, Thomas, GAD3R 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
This question already has an answer here:
Two files with a common field - is it possible to sort one based on the other?
3 answers
I'm trying to sort the /etc/passwd
numerically by user id numbersb(third field) in ascending order and then send it to s4.
What command would I uses to do that? I'm on this for a while now.
linux sort
New contributor
This question already has an answer here:
Two files with a common field - is it possible to sort one based on the other?
3 answers
I'm trying to sort the /etc/passwd
numerically by user id numbersb(third field) in ascending order and then send it to s4.
What command would I uses to do that? I'm on this for a while now.
This question already has an answer here:
Two files with a common field - is it possible to sort one based on the other?
3 answers
linux sort
linux sort
New contributor
New contributor
edited Oct 4 at 11:00
Jeff Schaller
33.6k851113
33.6k851113
New contributor
asked Oct 4 at 10:30
Anonymous
104
104
New contributor
New contributor
marked as duplicate by Jeff Schaller, Goro, RalfFriedl, Thomas, GAD3R 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jeff Schaller, Goro, RalfFriedl, Thomas, GAD3R 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago
add a comment |Â
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Try the below code, Sort the /etc/passwd
based on uid.
sort -n -t ':' -k3 /etc/passwd
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
add a comment |Â
up vote
0
down vote
There is a specific command for sorting the /etc/passwd
file by UID:
# pwck -s
Just to be safe, you should use this instead of generic sort
if you're sorting the actual, active /etc/passwd
file for your system, as pwck
will handle the necessary file locking correctly. Otherwise strange things might happen if someone attempted to log in or even query some user information while you're replacing the /etc/passwd file.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Try the below code, Sort the /etc/passwd
based on uid.
sort -n -t ':' -k3 /etc/passwd
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
add a comment |Â
up vote
1
down vote
accepted
Try the below code, Sort the /etc/passwd
based on uid.
sort -n -t ':' -k3 /etc/passwd
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Try the below code, Sort the /etc/passwd
based on uid.
sort -n -t ':' -k3 /etc/passwd
Try the below code, Sort the /etc/passwd
based on uid.
sort -n -t ':' -k3 /etc/passwd
answered Oct 4 at 10:46
EBIN GLADSON
3316
3316
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
add a comment |Â
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
Thank you very much for your command. I used a different command, but I think you one will work.
â Anonymous
Oct 4 at 11:20
add a comment |Â
up vote
0
down vote
There is a specific command for sorting the /etc/passwd
file by UID:
# pwck -s
Just to be safe, you should use this instead of generic sort
if you're sorting the actual, active /etc/passwd
file for your system, as pwck
will handle the necessary file locking correctly. Otherwise strange things might happen if someone attempted to log in or even query some user information while you're replacing the /etc/passwd file.
add a comment |Â
up vote
0
down vote
There is a specific command for sorting the /etc/passwd
file by UID:
# pwck -s
Just to be safe, you should use this instead of generic sort
if you're sorting the actual, active /etc/passwd
file for your system, as pwck
will handle the necessary file locking correctly. Otherwise strange things might happen if someone attempted to log in or even query some user information while you're replacing the /etc/passwd file.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
There is a specific command for sorting the /etc/passwd
file by UID:
# pwck -s
Just to be safe, you should use this instead of generic sort
if you're sorting the actual, active /etc/passwd
file for your system, as pwck
will handle the necessary file locking correctly. Otherwise strange things might happen if someone attempted to log in or even query some user information while you're replacing the /etc/passwd file.
There is a specific command for sorting the /etc/passwd
file by UID:
# pwck -s
Just to be safe, you should use this instead of generic sort
if you're sorting the actual, active /etc/passwd
file for your system, as pwck
will handle the necessary file locking correctly. Otherwise strange things might happen if someone attempted to log in or even query some user information while you're replacing the /etc/passwd file.
answered 2 days ago
telcoM
12.2k11435
12.2k11435
add a comment |Â
add a comment |Â
What have you been trying? It may be useful for someone to explain not only what does work, but also why what you'd tried didn't work.
â roaima
2 days ago