Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to commpare to file and get missing lines out of it,
but it was not working, kindly assist on this issue..
file1:
dewdfg1234
vml123
file2:
DEWDFG1234
vml1245
vml23
out i should get here is:
vml1245
but i am getting:
vml1245
dewdfg1234 --> i should not get this because it is already there in two files one with CASE. but below commands it is not ignoring the case
man diff
DIFF(1) User Commands DIFF(1)
NAME
diff - compare files line by line
SYNOPSIS
diff [OPTION]... FILES
DESCRIPTION
Compare FILES line by line.
Mandatory arguments to long options are mandatory for short options too.
--- a long output edited out
Hi,
I want to commpare to file and get missing lines out of it, but it was not working, kindly assist on this issue..
file1:
dewdfg1234
vml123
file2:
DEWDFG1234
vml1245
vml23
out i should get here is:
vml1245
but i am getting:
vml1245
dewdfg1234 --> i should not get this because it is already there in two files one with CASE. but below commands it is not ignoring the case
comm -12 file1 file2
grep -v -f file1 file2
After being a member here for seven years now, you should be well aware that you need to do basic research first. As with the numerous other threads you've posted over the years wanting people to write scripts for you, this one also shows little effort.
You can either translate both files to all upper-case and do your comparison, or look at the man page on diff which will ignore case. Again, do basic research on your own first.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.