![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Feb 2004
Location: Right next to you....
Posts: 1,148
|
linux guru help, command diff
Is there anyone in here who has experience with the command "diff" in linux,
I have a list with names "names.txt" and i have a list with names that should be removed from "names.txt" and it should generate an output of names.txt with the names from the remove list removed. ![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2004
Location: Right next to you....
Posts: 1,148
|
anyone ???
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Join Date: Feb 2004
Location: Right next to you....
Posts: 1,148
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Sep 2003
Posts: 509
|
man sort
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Registered User
Join Date: Jun 2003
Posts: 89
|
diff -c <filename> <filename.orig> > whatever.txt
__________________
Don't look here |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
you want to use comm, not diff. comm -3 names.txt remove.txt > clean.txt Usage: comm [OPTION]... FILE1 FILE2 Compare sorted files FILE1 and FILE2 line by line. With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files. -1 suppress lines unique to FILE1 -2 suppress lines unique to FILE2 -3 suppress lines that appear in both files
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Quote:
Code:
gw00# cat test.txt gofuckyourself.com brujah is a wannabe gw00# cat test2.txt gofuckyourself.com gw00# cat test.txt test2.txt|sort|uniq -u brujah is a wannabe ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
I was wrong. Didn't know the -u option, but the comm command seemed perfect for this. Congrats, you've been a real prick about it. Always good to know who the assholes are.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Feb 2004
Location: Right next to you....
Posts: 1,148
|
Both lists will need to be sorted when i use the comm command, right ?
|
![]() |
![]() ![]() ![]() ![]() ![]() |