Hi,
I am trying to find the files in a specific directory that are currently in open state. I need this information to archive the old files that are not active in the directory.
I get the following output when I try the command
[root@myhadoop tmp]$ lsof +d '/var/tmp/'|awk '{print $9}'|sort -u
NAME
/var/tmp
/var/tmp/abc.txt
/var/tmp/xyz.txt
/var/tmp/123.txt
I do not want to see the first 2 lines which are the header info and the directory path where the files are being searched from.
I can use the sed command to get rid of the first 2 lines, but I was wondering if there is any better way to handle this.
Thanks
-Vicky