If you want to compare the same data in two files, you can use the comm command. If you need to find the rows containing certain data, you still need to extract the data in file A first. For example, A is 100, 200, 300, then we can use egrep '[1-3]00' b, This is how the results came out. But when it comes to some more complex file comparisons, it is recommended to use shell, awk, or python to handle it.
Execute command
];next}{for(i in x)if(🎜~i)print}' a b🎜grep -f a b
即可使用awk的话,可以这样
awk 'NR==FNR{x[
If you want to compare the same data in two files, you can use the comm command.
If you need to find the rows containing certain data, you still need to extract the data in file A first. For example, A is 100, 200, 300, then we can use egrep '[1-3]00' b, This is how the results came out.
But when it comes to some more complex file comparisons, it is recommended to use shell, awk, or python to handle it.