Interview Questions and Answers in Linux: Part-3
Hello everyone, This is the third part of the interview questions and answers in Linux. Along with that will go through some examples also. I will create a series of questions and answers for beginners to advanced levels.
Both are used for viewing large files page-wise.
'less' is faster, it doesn't load the entire file at once, and allows navigations using up/down keys.
It is used to permanently delete data that you don't want to be recovered.
find:
- works in real-time
- searches all directories.
- Examine each file one by one.
- requires a lot of I/O calls, and takes longer to get results.
locate:
- Works in offline mode.
- Searches files in updated db.
- Comparatively quicker but the results are not as fresh as 'find'.
pr -l 60 {file_name} [default 66]
- sar [commands]
- logs are stored in /var/log/sadd file
vmstat or free
Cron:
- Granularity is in minutes.
- Normal users can schedule.
- Expects the system up and running.
Anacron:
- Granularity is in days.
- Only superusers can schedule.
- Doesn't expect to execute as soon as the system is up and running.
A shadow password system file is known as /etc/shadow. It stores encrypted user passwords and it can only access by a root user.
Earlier Linux file system stores in /etc/passwd but it is vulnerable, to avoid this vulnerability newer version of Linux stores password in /etc/shadow (it's in hashed)