Hello,
I have few file such as below:
abc.txt
def.txt
ghi.txt
jkl.txt
n.txt
I would like to merge all these files together into one file. At the same time, any duplicates will be removed.
Hello,
I have few file such as below:
abc.txt
def.txt
ghi.txt
jkl.txt
n.txt
I would like to merge all these files together into one file. At the same time, any duplicates will be removed.
cat *.txt | sort -u > output.txt
You can also try:
awk '!a[$0]++' abc.txt def.txt ghi.txt jkl.txt n.txt > new_file
what if those files are located on few different directories?
./2013/Jan/Fri/2013-01-11.log
./2013/Jan/Sat/2013-01-12.log
./2013/Jan/Tue/2013-01-15.log
./2013/Jan/Sun/2013-01-13.log
./2013/Jan/Thu/2013-01-10.log
./2013/Jan/Mon/2013-01-14.log
./2013/Jan/Wed/2013-01-16.log
im trying to make it as a variabe.
Why not use command substitution like
awk '...' $(ls ./2013/Jan/*/*.log)
?