BSW Soft
10+ Credit Fair Interview Questions and Answers
Q1. How will you edit an existing file on a Linux server?
To edit an existing file on a Linux server, you can use a text editor like Vim or Nano.
Use a text editor like Vim or Nano to open the file for editing
Make the necessary changes to the file
Save the changes and exit the text editor
Q2. How to check your current path/directory you are working in?
To check the current path/directory, use the 'pwd' command in Unix/Linux or 'cd' command in Windows.
In Unix/Linux, type 'pwd' and press Enter
In Windows, type 'cd' and press Enter
Q3. How to check tha computer name of hostname in linux
To check the computer name or hostname in Linux, you can use the 'hostname' command.
Use the 'hostname' command to display the current hostname of the system.
To change the hostname, use the 'hostnamectl set-hostname' command followed by the new hostname.
To view the fully qualified domain name (FQDN), use the 'hostname -f' command.
Q4. How to check tha current user in linux terminal?
To check the current user in Linux terminal, you can use the 'whoami' command.
Use the 'whoami' command to display the current user's username.
Alternatively, you can also use the 'id' command to display information about the current user.
Q5. Which command to be used to a file in linux?
The command 'chmod' is used to change permissions of a file in Linux.
Use 'chmod' command followed by the permission code and the file name to change permissions of a file.
For example, 'chmod 755 file.txt' will give read, write, and execute permissions to the owner, and read and execute permissions to group and others.
Q6. Explain that difference between relative and absolute path?
Relative paths are based on the current directory, while absolute paths start from the root directory.
Relative paths are shorter and do not include the full path from the root directory.
Absolute paths start from the root directory and include the full path to the file or directory.
Example of relative path: 'folder/file.txt'
Example of absolute path: '/home/user/folder/file.txt'
Q7. How to search for a string in a file?
To search for a string in a file, you can use tools like grep or findstr.
Use the grep command in Unix/Linux systems: grep 'search_string' file_name
Use the findstr command in Windows systems: findstr 'search_string' file_name
You can also use text editors like Vim or Notepad++ to search for a string in a file
Q8. What is the use of echo command
The echo command is used to display a line of text or a variable value in the terminal.
Used to print text or variable values to the terminal
Can be used to create simple scripts or display messages to users
Commonly used in shell scripting to output information
Q9. How to rename a file in linux?
To rename a file in Linux, you can use the 'mv' command.
Use the 'mv' command followed by the current file name and the new file name
Make sure to specify the full path if the file is not in the current directory
You can also use relative paths for the file names
Q10. Difference between grep and egrep?
grep is a basic pattern matching tool, while egrep is an extended version with support for regular expressions.
grep is a basic command-line utility for searching plain text data for lines that match a regular expression pattern.
egrep is an extended version of grep that supports extended regular expressions.
egrep is equivalent to grep -E, enabling the use of extended regular expressions like +, ?, |, () in the pattern.
egrep is more powerful and flexible compared to grep for co...read more
Top System Administrator Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month