Question: I have an indeterminated number of csv files in one folder. All the CSV have only one column with diferent number of rows, like this:

File1.csv

```
rs1000
rs2000
rs4000
rs5000
...

```

I want to compare all the CSV files in that folder and output a CSV file with only the rows that are in common in all the files. 
I have this command:

```
awk -F'|' 'NR==FNR{c[$1$2]++;next};c[$1$2] > 0' *.csv > out_p.csv

```

but it shows rows that are not in all the files.

Answer: 
I didn't test, but it should work.

```
awk '{line[$0]++}END{for(x in line)if(line[x]==ARGC-1)print x} *.csv

```

* The one-liner reads all lines into a hashtable (awk array)
* Increments the value(occurrence) each time
* Finally print out the lines with occurrence same as the count of `*.csv` files.
* **Note, assume that each csv file has no duplicated lines**
Try something like this:

```
awk '{ array[$1]++ } END { for(i in array) { if(array[i] > 1) print i } }' *.txt

```

Each csv file has only one column so you don't need to specify a field separator, a line is printed if it exists more than once in all the csv files.