One of the common Linux interview question to developer is "Print top 5 largest directories in Linux using du command". In the past, I have shared 30 UNIX command interview questions and Linux interview questions and today, we will discuss this problem and learn what to do if it comes on interview, or more likely you face this in your day to day work as developer, IT support or System administrator. If Interviewer ask you to print top 5 biggest directories by size instead of files then you can use the du (disk usage) command to find directories. The du command will list down size of every file and directory and then you can use the sort command to sort them in descending order by using -n and -r option.
Monday, August 12, 2024
Friday, March 1, 2024
Difference between known_hosts and authorized_keys file in SSH - Linux
If you have used SSH to login into remote host in Linux, you might have come across these two files stored under the .ssh directory in your home directory e.g. ~/.ssh. Both files are used in the login process for authentication, but the main difference between known_hosts and authorized_keys files are that, known_host is used for server authentication, while authorized_keys are used for client or user authentication. SSH allows login using both password and private keys, you might have heard about trusted SSH connection between two host to download files without entering password, this is achieved using public and private keys.
Labels:
linux
,
Linux interview questions
,
SSH
,
unix
Subscribe to:
Posts
(
Atom
)