stat project/ : This will display detailed metadata and details about the directory.
.testfile : means hidden file, every file if we put . that means a hidden file
yum list installed: To check install software
hi
Difference between absolute path and relative path ?
- Absolute Path: An absolute path specifies the complete location of a file or directory from the root directory (
/
in Linux or C:\
in Windows).
- Relative Path: A relative path specifies the location of a file or directory relative to the current working directory.
Command to find empty files in a given directory?
find /path/to/directory -type f -empty
Delete empty file
find . -type f -empty -delete
I want to delete log which is 10 days old in Linux ?
find /path/to/logs -type f -mtime +10 -exec rm -f {} \;
Explain the difference between chmod, chown, and chgrp.
chmod
: Modifies the file or directory permissions (read, write, and execute).
chown
: Changes the ownership of a file or directory. It assigns a new user and/or group as the owner.
chgrp
: Changes the group ownership of a file or directory.