-1

I need help trying run whoami and get userid and then run df -k to find all filesystem that are own by userid.

The following command I have, but does not work.

whoami | awk '{print $1}' | xargs -I '{}' df -k | grep '{}'
  • It's not clear what you're trying to do here. Filesystems aren't owned by users. –  Jun 15 '16 at 16:55
  • For example, I am in login as john on a servers. Then I want to run whoami to get current userid (which is john), then I want to run df -k | grep john. This will give me all filesystems that are own by john. So, I want use xargs. Basically run whoami then redirect the output to df -k command. – azad aawaraa Jun 15 '16 at 17:14

1 Answers1

0

It was easier then that I thought. Following command works

df -k | grep  `whoami`

This will show all filesystems that userid who run the command.