We have a number of files:
1~peter~hello.txt
2~tom~bye.txt
3~ken~love.txt
4~tom~good.txt
we would like to search for 2nd field containing "tom" and print the
whole filenames.
2~tom~bye.txt
4~tom~good.txt
we would search something like this:
eg. ls . | awk -F"~" '{print $0}'
pls advise what awk construct could give my output.