We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8
Q What is Linux?
A Linux is an operating system or a kernel distributed under an open-source license. Its
functionality list is quite like UNIX. The kernel is a program at the heart of the Linux operating system that takes care of fundamental stuff, like letting hardware communicate with software. Q What is the difference between UNIX and LINUX? A Unix originally began as a propriety operating system from Bell Laboratories, which later on spawned into different commercial versions. On the other hand, Linux is free, open source and intended as a non-propriety operating system for the masses. Q What is BASH? A BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the original Bourne Shell (represented by /bin/sh). It combines all the features from the original version of Bourne Shell, plus additional functions to make it easier and more convenient to use. It has since been adapted as the default shell for most systems running Linux. Q What is the advantage of open source? A Open source allows you to distribute your software, including source codes freely to anyone who is interested. People would then be able to add features and even debug and correct errors that are in the source code. They can even make it run better and then redistribute these enhanced source code freely again. This eventually benefits everyone in the community. Q Describe the root account. A The root account is like a systems administrator account and allows you full control of the system. Here you can create and maintain user accounts, assigning different permissions for each account. It is the default account every time you install Linux. Q Are drives such as hard drive and floppy drives represented with drive letters? A No. In Linux, each drive and device have different designations. For example, floppy drives are referred to as /dev/fd0 and /dev/fd1. IDE/EIDE hard drives are referred to as /dev/hda, /dev/hdb, /dev/hdc, and so forth. Q How do you change permissions under Linux? A Assuming you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or – symbol to deny permission, along with any of the following letters: u (user), g (group), o (others), a (all), r (read), w (write) and x (execute). For example, the command chmod go+rw FILE1.TXT grants read and write access to the file FILE1.TXT, which is assigned to groups and others. Q What are hard links? A Hard links point directly to the physical file on disk, and not on the pathname. This means that if you rename or move the original file, the link will not break since the link is for the file itself, not the path where the file is located. Q What is the pwd command? A The pwd command is short for print working directory command. Q What are daemons? A Daemons are background process or services that provide several functions that may not be available under the base operating system. Its main task is to listen for service request and at the same time to act on these requests. After the service is done, it is then disconnected and waits for further requests. Q What are the kinds of permissions under Linux? A There are 3 kinds of permissions under Linux:- Read: users may read the files or list the directory Write: users may write to the file of new files to the directory Execute: users may run the file or lookup a specific file within a directory Q What are environmental variables? A Environmental variables are global settings that control the shell’s function as well as that of other Linux programs. Another common term for environmental variables is global shell variables. Example: PATH, LOGNAME, PS1, PS2 Q What are the different modes when using vi editor? A There are 3 modes under vi:- Command mode – this is the mode where you start in, in this mode inserted characters are treated as vi commands. Esc key is used to enter command mod Edit mode or insert mode– this is the mode that allows you to do text editing. The key ”i“is used to enter edit mode Ex mode – This mode is also called last line mode. This mode is used to save file or quit vi editor. Press “:” key to enter Ex mode. Q What is redirection? A Redirection is the process of directing data from one output to another. It can also be used to direct an output as an input to another process. Q How can you find the status of a process? Use the command A ps Q How can you append one file to another in Linux? A To append one file to another in Linux you can use command cat file2 >> file 1. The operator >> appends the output of the named file or creates the file if it is not created. While another command cat file 1 file 2 > file 3 appends two or more files to one.
Q Explain how you can create a folder using Terminal?
A To create a folder, you have to use command mkdir.It will be something like these: mkdir dirname
Q What is the purpose of the 'sudo' command in Linux?
A: The 'sudo' command in Linux allows users to execute commands with superuser or root privileges, granting them the necessary permissions to perform administrative tasks. Q: What is the 'grep' command used for in Linux? A: The 'grep' command is used to search text for patterns or specific strings within files. It's a powerful tool for text processing and searching. Q: What is a shell in Linux? A: A shell is a command-line interface that allows users to interact with the Linux operating system. Common shells include Bash, Zsh, and Fish. Q: What is the purpose of the 'passwd' command in Linux? A: The 'passwd' command is used to change a user's password in Linux. It can also be used by administrators to manage user account passwords. Q: What does the 'ps' command do in Linux? A: The 'ps' command is used to display information about running processes on a Linux system, including their process IDs (PIDs), resource usage, and status. Q: How can you terminate a running process in Linux? A: You can terminate a running process in Linux using the 'kill' command followed by the process ID (PID) or by using 'pkill' to kill processes by name. Q: What is a package manager in Linux? A: A package manager is a software tool used to manage the installation, removal, and updating of software packages on a Linux system. Examples include 'apt', 'yum', and 'rpm'. Q: What is the purpose of the 'ls' command in Linux? A: The 'ls' command is used to list files and directories in the current directory or a specified location. It provides information such as file names, sizes, and permissions. Q: How can you create a symbolic link in Linux? A: You can create a symbolic link in Linux using the 'ln -s' command, where '-s' indicates that you're creating a symbolic (soft) link to a target file or directory. Q: What is a Linux kernel? A: The Linux kernel is the core component of the Linux operating system. It manages hardware resources, facilitates communication between software and hardware, and controls system processes. Q: What is the purpose of the 'cron' in Linux? A: 'cron' is a time-based job scheduler in Linux that allows users to schedule and automate tasks at specified intervals, such as running scripts or commands at specific times or on certain days. Q: What is a shell script in Linux? A: A shell script is a text file containing a series of commands that can be executed in sequence. It allows users to automate tasks and perform complex operations by running the script in a shell or terminal. Q: How do you rename a file or directory in Linux? A: To rename a file or directory in Linux, you can use the 'mv' command, followed by the current name and the desired new name. For example, mv oldname.txt newname.txt renames a file. Q: What is the purpose of the 'top' command in Linux? A: The 'top' command is used to display real-time information about system processes, including CPU usage, memory usage, and other system statistics. It provides a dynamic view of system performance. Q: How do you find out your current working directory in Linux? A: You can find out your current working directory in Linux using the 'pwd' (print working directory) command. Q: What command is used to display the manual pages for other commands in Linux? A: The 'man' command is used to display manual pages for other commands in Linux. For example, 'man ls' shows the manual for the 'ls' command. Q: How do you create a new user in Linux? A: To create a new user in Linux, you can use the 'useradd' command followed by the username. For example, 'sudo useradd newuser' creates a new user named 'newuser'. Q: What command is used to view and manipulate environment variables in Linux? A: The 'env' command displays environment variables, while 'export' is used to set or modify environment variables in Linux. Q: How can you display the last few lines of a text file in Linux? A: You can display the last few lines of a text file in Linux using the 'tail' command. For example, 'tail myfile.txt' shows the last 10 lines by default. Q: How do you search for files or directories with a specific name in Linux? A: You can use the 'find' command to search for files or directories with a specific name in Linux. For example, 'find /path/to/search -name filename' searches for 'filename' in the specified path. Q: What command is used to delete a file in Linux? A: The 'rm' command is used to delete files in Linux. For example, 'rm myfile.txt' deletes the 'myfile.txt' file. Q: How can you list all running processes in Linux? A: You can list all running processes in Linux using the 'ps ' command. This command displays a detailed list of all processes running on the system. Q: What is the purpose of the 'mount' command in Linux? A: The 'mount' command is used to attach filesystems to the directory tree in Linux. It allows you to access external storage devices or network shares. Q: How do you create a compressed tar archive in Linux? A: To create a compressed tar archive in Linux, you can use a command like 'tar -czvf archive.tar.gz /directory/to/archive'. This command compresses and archives the specified directory. Q: What command is used to display the disk space usage of a directory and its subdirectories in Linux? A: The 'du' (disk usage) command is used to display the disk space usage of a directory and its subdirectories in Linux. For example, 'du -h /path/to/directory' shows disk usage in human-readable format. Q: How do you change the permissions of a file in Linux? A: You can change the permissions of a file in Linux using the 'chmod' command followed by the desired permission settings. For example, 'chmod 644 myfile.txt' sets read and write permissions for the owner and read-only permissions for others. Q: What is the purpose of the 'chown' command in Linux? A: The 'chown' command is used to change the ownership of files and directories in Linux. It allows you to specify a new owner and optionally a new group. Q: How do you display a list of currently logged-in users in Linux? A: You can display a list of currently logged-in users in Linux using the 'who' or 'w' command. Q: How can you create a new empty file in Linux? A: You can create a new empty file in Linux using the 'touch' command, followed by the filename. For example, 'touch newfile.txt' creates an empty file named 'newfile.txt'. Q: What command is used to view and manipulate the contents of text files in Linux? A: The 'cat' command is commonly used to view the contents of text files in Linux. You can also use text editors like 'nano' or 'vim' to manipulate and edit text files. Q: How do you display a list of available network interfaces on a Linux system? A: You can display a list of available network interfaces on a Linux system using the 'ifconfig' or 'ip link' command. Q: How can you compress and archive files into a zip file in Linux? A: To compress and archive files into a zip file in Linux, you can use the 'zip' command. For example, 'zip archive.zip file1.txt file2.txt' compresses 'file1.txt' and 'file2.txt' into 'archive.zip'. Q: What command is used to find and replace text within a file in Linux? A: The 'sed' command is often used to find and replace text within a file in Linux. For example, 'sed 's/old-text/new-text/g' inputfile > outputfile' replaces all occurrences of 'old- text' with 'new-text' in 'inputfile' and saves the result in 'outputfile'. Q: How do you list all available network ports that a Linux system is listening on? A: You can use the 'netstat' or 'ss' command to list all available network ports that a Linux system is listening on. For example, 'netstat -tuln' displays a list of listening TCP and UDP ports. Q: How do you view and navigate the contents of a large text file in Linux without opening it? A: You can use the 'less' command to view and navigate the contents of a large text file in Linux without opening it entirely. Simply type 'less filename' to enter the viewer and use arrow keys or other commands to navigate. Q: How can you copy a file from one directory to another in Linux? A: You can copy a file from one directory to another in Linux using the 'cp' command. For example, 'cp file.txt /destination/directory' copies 'file.txt' to the specified destination directory. Q: How do you display the content of a text file in Linux? A: You can display the content of a text file in Linux using the 'cat' command. For example, 'cat myfile.txt' shows the contents of 'myfile.txt'. Q: How can you find a file by its name in Linux? A: You can find a file by its name in Linux using the 'find' command. For example, 'find /path/to/search -name filename' searches for 'filename' in the specified path. Q: What command is used to list files and directories in a long format with additional information like permissions and ownership? A: The 'ls -l' command is used to list files and directories in a long format, providing detailed information about permissions, ownership, file size, and more. Q: What is the purpose of the 'sed' command in Linux? A: The 'sed' (stream editor) command is used to filter and transform text. It can be used to search for patterns and replace them, among other text manipulation tasks. Q: What is the purpose of the 'sed' command in Linux? A: The 'sed' (stream editor) command is used to filter and transform text. It can be used to search for patterns and replace them, among other text manipulation tasks. Q: How can you use 'uniq' to count the number of occurrences of each unique line in a sorted file? A: You can use 'uniq -c' to count the number of occurrences of each unique line in a sorted file. For example, sort input.txt | uniq -c sorts 'input.txt' and counts the occurrences of each unique line. short Answers Physical partitioning can be done using: fdisk command RPM stands for :Red Hat Package Manager Q which command is used to change a directory? A: Cd clmmand Q: Which command is used to copy the content of one file to another? A: cp Q: Which command is used to remove a directory? A: rmdir Q: Which command is used to remove a directory with its content? A: rm –r dirname Q: Which command is used to display the content of the file page by page> A: more or less command Q: Commands used to create file A; cat, touch, vi cpmmand Q : command used to display unique lines in the file A: uniq Q: command used to sort the content of the file A: sort command Q: commands used to perform arithmetic opeartions A: bc, expr