I'm using fuser
with options -uv
and I'm getting following output:
$fuser -uv ~/sh/test_script.sh
USER PID ACCESS COMMAND
/home/abc/sh/test_script.sh:
abc 3501 f.... (abc)test_script.sh
However, when I try to redirect the output of the command I'm only getting PID in the file:
$fuser -vu ~/sh/test_script.sh >> t2.txt
USER PID ACCESS COMMAND
/home/abc/sh/test_script.sh:
abc f.... (abc)test_script.sh
$cat t2.txt
3501
Why is it not including all the information during output redirection?
Also, how to include all the information during output redirection?
Using lsof
I'm able to redirect all the information to a file.