top unix interview questions part 1

  1. What is the difference between a hard link and a symbolic link in Unix?
    A hard link is a file system object that points to another file on the same file system. A symbolic link, also known as a symlink or soft link, is a special type of file that contains a reference to the file or directory it links to.

  2. How do you check the current version of Unix or Linux running on a system?
    The command ‘uname -a’ will display the current version and build information of the Unix or Linux operating system.

  3. How do you check the amount of free and used memory on a Unix or Linux system?
    The command ‘free -m’ will display the amount of free and used memory in megabytes on a Unix or Linux system.

  4. How do you check the amount of free and used disk space on a Unix or Linux system?
    The command ‘df -h’ will display the amount of free and used disk space in human-readable format on a Unix or Linux system.

  5. How do you check the current users logged into a Unix or Linux system?
    The command ‘who’ will display the list of current users logged into a Unix or Linux system.

  6. How do you check the current processes running on a Unix or Linux system?
    The command ‘ps -ef’ will display a list of current processes running on a Unix or Linux system.

  7. How do you check the current network connections on a Unix or Linux system?
    The command ‘netstat -an’ will display a list of current network connections on a Unix or Linux system.

  8. How do you check the current routing table on a Unix or Linux system?
    The command ‘route -n’ will display the current routing table on a Unix or Linux system.

  9. How do you check the uptime of a Unix or Linux system?
    The command ‘uptime’ will display the uptime of a Unix or Linux system.

  10. How do you check the current system load on a Unix or Linux system?
    The command ‘top’ will display the current system load, including the CPU and memory usage, on a Unix or Linux system.

These are some of the basic but important questions that you may be asked in an interview for a Unix or Linux administrator or engineer role. It is important to have a good understanding of these basic commands and their usage in order to effectively manage and troubleshoot a Unix or Linux system.

  1. How do you create a new user in Unix or Linux?
    The command ‘useradd’ is used to create a new user in Unix or Linux. The syntax for this command is ‘useradd [options] username’. For example, to create a new user with the username ‘john’, the command would be ‘useradd john’. This command will create a new user account with default settings. To set custom settings such as home directory, shell, and expiry date, you can use options such as ‘-d’, ‘-s’, and ‘-e’ respectively.

  2. How do you change a user’s password in Unix or Linux?
    The command ‘passwd’ is used to change a user’s password in Unix or Linux. The syntax for this command is ‘passwd [options] username’. For example, to change the password for the user ‘john’, the command would be ‘passwd john’. This command will prompt the user to enter and confirm the new password.

  3. How do you delete a user in Unix or Linux?
    The command ‘userdel’ is used to delete a user in Unix or Linux. The syntax for this command is ‘userdel [options] username’. For example, to delete the user ‘john’, the command would be ‘userdel john’. This command will delete the user account and the user’s home directory. To retain the home directory, you can use the ‘-r’ option.

  4. How do you manage permissions in Unix or Linux?
    Permissions in Unix or Linux are managed using the ‘chmod’ command. The syntax for this command is ‘chmod [options] mode file’. The mode can be specified in octal notation or in symbolic notation. For example, to give read and write permissions to the owner, read permissions to the group, and no permissions to others for a file called ‘file.txt’, the command would be ‘chmod 740 file.txt’.

  5. How do you manage file ownership in Unix or Linux?
    File ownership in Unix or Linux is managed using the ‘chown’ command. The syntax for this command is ‘chown [options] owner:group file’. For example, to change the ownership of a file called ‘file.txt’ to the user ‘john’ and the group ‘users’, the command would be ‘chown john:users file.txt’.

  6. How do you create and manage directories in Unix or Linux?
    Directories in Unix or Linux are created using the ‘mkdir’ command. The syntax for this command is ‘mkdir [options] directory’. For example, to create a new directory called ‘docs’, the command would be ‘mkdir docs’. To remove a directory, you can use the ‘rmdir’ command. To navigate between directories, you can use the ‘cd’ command.

In addition to the above commands, there are many other tools and utilities available in Unix and Linux to manage the file system, monitor system resources, troubleshoot issues, and perform various other tasks. It is important to have a good understanding of the various commands and their usage to be able to effectively manage a Unix or Linux system.

Popular questions

  1. What is the command to check the current version of Unix or Linux running on a system?
    Answer: The command ‘uname -a’ will display the current version and build information of the Unix or Linux operating system.

  2. How do you check the amount of free and used disk space on a Unix or Linux system?
    Answer: The command ‘df -h’ will display the amount of free and used disk space in human-readable format on a Unix or Linux system.

  3. How do you create a new user in Unix or Linux?
    Answer: The command ‘useradd’ is used to create a new user in Unix or Linux. The syntax for this command is ‘useradd [options] username’. For example, to create a new user with the username ‘john’, the command would be ‘useradd john’.

  4. How do you manage permissions in Unix or Linux?
    Answer: Permissions in Unix or Linux are managed using the ‘chmod’ command. The syntax for this command is ‘chmod [options] mode file’. The mode can be specified in octal notation or in symbolic notation.

  5. How do you navigate between directories in Unix or Linux?
    Answer: To navigate between directories, you can use the ‘cd’ command. The command 'cd' will take you to the home directory and 'cd directory_name' will take you to the directory_name directory.

Tag

Unix.

Posts created 2498

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top