Linux 101 : Playing around with the "find" command



We could see the user ID and the group ID of a file using for example the below command:


We could use "find" to look for files according to their user ID - 1001 -:


We could also do it with the group ID of the file:


And with the name of the file of course:


Or with the group name of the file:


Changing all the file with the user ID 1001 to user ID 1050:



Bulk moving files according to their user ID - 1001 -:


Remark:

  • -r : is for recursive through all the subdirectories.
  • {} : referes to the output of the previous command.

To find "ghost" files owned by a non-existing users, we could use the below command: 


To find "ghost" files owned by a non-existing user groups, we could use the below command: 

Comments

Leave as a comment:

Archive