I am working on a Linux cluster that is accessed by many people. I would like to list all the files in all directories that have been created by me. I want to do this because there is a lot of content and many of the directories are quite messy so I would like to keep to cluster clean at least on my behalf. Going manually through all the directories is laborious so I tried to come up with a bash code to do this for me:

ls --author -l -R | awk '$5=="my_user_name" {print $0}' | less

I execute this from the root directory. What would be a more efficient way of doing this ? Also I am wondering is this kind of code safe to use since I don't have permissions to most of the files on the cluster.


This might help you,

find / -user "your_username" -print

That will print all files, directories starting from / partition which belongs to you.

  • 1
    and to make it cleaner, you might append '2>/dev/null' so that you don't see all the "permission denied"
    – Jeff Schaller
    Aug 8 '16 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.