You can check file ownership in Linux using the ls -l command. This command lists files and directories in a detailed format, showing the owner and group associated with each file. Here's how to use it:
ls -l filename
Replace filename with the name of the file or directory you want to check. The output will look something like this:
-rw-r--r-- 1 owner group size date time filename
In this output:
owneris the username of the file's owner.groupis the group associated with the file.
If you want to check ownership for all files in a directory, simply run:
ls -l
This will display the ownership information for all files and directories in the current directory.
