0% found this document useful (0 votes)
32 views12 pages

Unit - 1 Course File Questions and Answers and Model Papers Question and Answers

Uploaded by

vsc007143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views12 pages

Unit - 1 Course File Questions and Answers and Model Papers Question and Answers

Uploaded by

vsc007143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

UNIT-1

Short Answer Questions

1. Define Computer?
A computer is an electronic device that can be programmed to accept the data in the form of input and
generates the data in the form of output. A computer can also store the information in the memory.

2. List out the components of a computer system

3. The computer language that most closely resembles machine language is Assembly language.

4. List out the differences between RAM and ROM?

5. What is an executable file?

An executable file is a type of computer file that contains a program capable of being run or executed
by a computer.

6. Write the extensions of various files?


Document Files : .doc, .pdf, .ppt, .txt
Image Files: ,jpg, .png, .gif
Audio Files; .mp3,
Video Files : .mp4
Executable Files: .exe, .sh
Compressed Files: .zip, .rar
Web Files: .html, .css, .js

7. What is an Operating System (OS) and list out various Operating Systems?

Operating System:
The operating system (OS) is a special category of system software that manages all the components of
a computer.
OS is an interface between user and computer.
Ex: Windows, Android, MacOS etc.
list out various Operating Systems:
The functions of operating system is of 8-types:
1. Security
2. Networking
3. Error Detection
4. Memory Management
5. Process Management
6. Device Management
7. File Management
8. Job Accounting

8. unit – 2

9. unit-2

10. Which command is used to move all files to the bien sub-directory of the parent directory?

$ mv * ../bin/

mv: The command used to move files/rename files.


*: A wildcard that represents all files in the current directory.

../bin/: The path to the bin sub-directory located in the parent directory (the .. refers to the parent directory).

11. Which command is used to change protection mode of files starting with the string emp andending
with 1, 2, or 37 ?

$ chmod <permissions> emp{1,2,37}

Where, chmod <permissions>: Replace <permissions> with the desired permission settings.

emp{1,2,37}: This uses brace expansion to match files that start with emp and end with either 1, 2, or 37.

12. Which command is used to remove the read permission of the file 'note' from both the group & others
?

$ chmod go-r note

Where, chmod: The command used to change file permissions.


go-r note: g refers to the group.
o refers to others.
-r indicates that you want to remove the read permission.
note: The name of the file you are modifying.

13. Which key is used to move the cursor to the end of the paragraph?

To move the cursor to the end of the paragraph, you can usually press the End key.
14. What is the vi command to change Case for 4 characters form the current position?
$ ~4
Where, ~: This command toggles the case of the character under the cursor.
4: This specifies that you want to apply the command to the next 4 characters.
15. What is the command to mail a letter to 5 users?
$ mail [email protected] [email protected] [email protected] [email protected]
[email protected]
- After typing the command above, press Enter.
- You'll be prompted to enter the subject of the email. Type your subject and press Enter.
- Then, write your message. After you finish, press Ctrl + D to send the email.
Essay Type Questions
1. Write down the salient features of UNIX?

 The features of UNIX are of 8 - types :

1. Portable
2. Multi – user
3. Multi - tasking
4. Networking
5. Organized file system
6. Device independence
7. Utilities
8. Services

1. Portable

 Unix is highly portable.


 It can be easily adopted to run on different computers.

2. Multi –User

 It is an environment where hundreds of users can connect to the Internet daily.


 The Unix allows multiple users to access the system at a same time.

3. Multi Tasking :

 It allows a user to run more than one job at a time.


 In Unix a user can start a task and then move to the another task daily without quitting from the first
one.

4. Networking

 UNIX allows the users to connect with the computers.


 It allows the users to share information easily.

5. Organized File system:

 Unix stores all the files in a proper order to find the files easily.

In Windows ------ C, D drives -------- Folders -------------------Files

In Unix ---- Root Directory ---- Home Directory ---- pwd ----- Files

6. Device Independence

 The Unix treats the input and output devices like a ordinary files is known as regular file.
 The source of input and output files can be easily controlled by a Unix feature is known as redirection.
Ex : cat > student_details.txt

7. Utilities

 There are tools like text editors that helps us to do the tasks easily.
 It has some small specialized commands that performs a specific task.

Ex: gedit, ls, cat, cp, rm, mv etc.

8. Services

 Services is a background process that runs continuously without any interaction from the user.
 The services are typically responsible for network connectivity, logging, scheduling tasks.

2. Explain the architecture of the UNIX with neat sketch ?

1. Hardware
 The Hardware layer of the Unix Operating System controls the use of physical system resources. such
as, memory and process managment, C,D driver etc.
 Hardware consists of peripheral devices are RAM, HDD, CPU etc.

2. Kernel :

 Kernal is an interface between hardware and shell.


 Kernel is the heart (main part) of Unix operating system.
The kernel consists of 2 parts :
1. Process control
2. Resource management
 Process Control has the ability to monitor and adjust the process to provide an desired output.
 Resource Management is used to manage the system resources such as CPU , memory, disk space
among the multiple processes.

3. shell

 Shell is an interface between the utilities and applications and kernel.


 Shell receives the command that entered by the user.
 The 2 major parts of shell :

1. Interpreter 2. Shell Script

 The Interpreter reads the user commands and works with the kernel to execute them .
 A Shell Script is a file that contains collection of shell commands that perform a specific task.

4. Utilities
 Utilities means the tools like a text editors that helps us to perform the tasks easily.
 It has some small specialized commands that performs a specific task. Ex: gedit, ls, cat, cp, rm, mv etc.
5. Applications / Application Programs :
 Application programs can be written by the system administrators and users. Such as MS word , spread
sheet (Excel) , powerpont presentations (PPT)

3. Explain file and directory handling commands/utilities in unix.

The various list of file and directory commands in Unix are:


1. present working directory (pwd)
2. create a new directiory (mkdir)
3. change directory (cd)
4. To exit an any directory (cd ..)
5. To create a multiple files command (touch)
6. To open a text editor (gedit)
7. concatenate files and print the standard output on the terminal (cat)
8. copy the files (cp)
9. move is used to rename a file (mv)
10. remove files from a directory (rm)
11. remove directory (rmdir)
12. ls (ls)
13. find

Note: Explain the above commands in detail

4. Explain how UNIX supports multiuser and multitasking environment.

Multiuser Support

1. Multiple Accounts: Many users can have their own accounts on the same system, each with a unique
username and password.
2. Permissions: Unix controls who can access files and directories through a permission system, ensuring
that users can only access their own data or what they are allowed to see.

Multitasking Support

1. Running Multiple Programs: Unix can run many programs at the same time. It handles this by sharing
CPU time among processes.
2. Creating New Processes: Users can start new programs easily, and Unix manages these programs
through command script.
3. Background and Foreground Tasks: Users can run tasks in the background (using &) while still using
the terminal for other commands, allowing them to multitask effectively.
4. Communication Between Programs: Unix has ways for programs to talk to each other, making it
easier to work with multiple tasks at once.

5. Write in detail a bout structure of man command ?

The man command is an essential tool for Unix/Linux users, providing comprehensive documentation
for commands and utilities. Understanding its structure and how to navigate it is crucial for effective
command-line usage.

A typical man page is structured into several sections:

1. Name: The name of the command and a brief description.


2. Synopsis: A summary of how to use the command, including its options.
3. Description: Detailed information about what the command does and how it works.
4. Options: A list of available options with descriptions of what they do.
5. Examples: Practical examples demonstrating how to use the command.
6. See Also: References to related commands or additional resources.

$ man [options] [command]

man: The command itself.


[options]: Optional flags that modify the behavior of the man command.

[command]: The name of the command or utility for which you want to see the manual.

Press q: Quit the man page viewer.

6. Explain the importance of mount, umount with examples?

The mount and umount commands in Unix/Linux are essential for managing file systems and storage devices.

The mount command is used to attach a file system (from a disk, USB drive, or network share) to a specific
directory in the existing file system hierarchy.

Without mounting, the operating system does not recognize or access the contents of storage devices.

Ex: $ sudo mount /dev/sdb1 /mnt/usb

The umount command is critical for safely disconnecting a mounted file system.

Using umount helps prevent data corruption. If a file system is unmounted improperly (e.g., by simply
unplugging a USB drive),

EX : $ sudo umount /mnt/usb

7. Unit -2
8. Unit-2
9. Discuss working of following commands with suitable examlpes :-
a) cal b) date
c) uname d) printf (echo)

a) cal

The cal command displays a calendar for a specified month or year.

Usage:

 Basic command: $ cal


 Specify month and year: $ cal 10 2023 (displays October 2023)
 Display current month: Simply run $ cal without arguments.

Example:

$ cal

b) date

The date command displays the current date and time. You can also format the output to show specific
information.

Usage:

 Basic command: $ date


 Custom format: $date +"%Y-%m-%d %H:%M:%S" (displays date in a specific format)

Example:

$ date

Output:

Fri Oct 20 14:32:50 UTC 2023

Custom Format Example:

$ date +"%Y-%m-%d %H:%M:%S"

Output:

2023-10-20 14:32:50
c) uname

The uname command prints system information such as the operating system name, kernel version, and
hardware architecture.

Usage:

 Basic command: $ uname


 Detailed information: $ uname -a (displays all available system information)

Example:

$ uname

Output:

Linux
Example:

$ uname -a

Output:

Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Thu Oct 15 00:00:00 UTC 2023 x86_64 x86_64
x86_64 GNU/Linux

d) printf (and echo)

Both printf and echo are used to output text to the terminal. printf offers more formatting options than echo.

Usage of echo:

 Basic command: echo "Hello, World!"

Example:

echo "Hello, World!"

Output:

Hello, World!

Usage of printf:

 Basic command: printf "Formatted string: %s\n" "Hello, World!"

Example:

printf "Formatted string: %s\n" "Hello, World!"

Output:

Formatted string: Hello, World!


Unit -1 Model Question Papers

Short

1. Write any 2 functions of operating system?

Process Management, Memory Management

2. Give any example for system software?

An example of system software is Microsoft Windows.

3. List any 2 input and output devices?

Input Devices:

1. Keyboard: Used to input text and commands into a computer.


2. Mouse: A pointing device used to interact with the graphical user interface.

Output Devices:

1. Monitor: Displays visual output from the computer.


2. Printer: Produces physical copies of documents and images.

4. What is the only octal value for the read permission while manipulating file permission?

The only octal value for the read permission in file permissions is 4. In the context of file permission
settings, the values are as follows:

 Read (r) = 4
 Write (w) = 2
 Execute (x) = 1

5. Which command is used to know the present working directory?

The command used to know the present working directory in a Unix/Linux environment is $ pwd.

6. Sketch the 5 statndard Unix shells?

1. Bourne Shell(sh)
2. Bash
3. C Shell (csh)
4. Korn Shell (ksh)
5. tcsh
7. Differentiate between computer hardware and software?

Hard Link Soft Link / Symbolic Link

It is comparatively faster than soft It is comparatively slower than hard


link. link.
Hard link can be used only with soft link can be used with both files
files. and directories.
Hard link acts as a copy of soft link does notacts as a copy of
original file. original file/directories.
If the original file is removed, if the original file is removed, then the
then also the hard link file has the soft link file does not have the access
access to work with that source / to work with the duplicate
duplicate file. file/directories.
In hard link both the files has the The soft link file consists of different
same inode number. inode numbers for both the files and
To know the inode address of a file directories. To know the inode address
$ ls –i filename of a file
$ ls –i filename.
To know the inode address of a
directory
$ ls –id filename
The ln command is used to create The ln -s command is used to create a
a hard link files. $ ln o.txt d.txt soft link files. $ ln –s original.txt
duplicate.txt

8. How does the os manage resources in a computer?

 The functions of operating system is of 8-types:


1. Security
2. Networking
3. Error Detection
4. Memory Management
5. Process Management
6. Device Management
7. File Management
8. Job Accounting

9. How are the variables used in Unix shell scripting?

 Variable is a memory location where the values can be stored.


 Each shell allows us to create, store and access values in the form of variables.
 Each shell variable must have a name.
 But In, Unix shell variables will be either Upper Case/lowercase.
Accessing Variables:
 To access the value stored in variable, prefix it’s name with $.
Long

1. Sketch the basic parts of a computer and describe the functions of operating system?

Refer Unit – 1 notes

2. Summarize the Unix architecture ?

Refer Unit – 1 notes

3. Define redirection ? Discuss redirection input, output and error?

Refer Unit – 1 notes

4. Explain the fundamental functions of an os and their significance in managing computer


resources?

the fundamental functions of an os


1. Security
2. Networking
3. Error Detection
4. Memory Management
5. Process Management
6. Device Management
7. File Management
8. Job Accounting

Refer Unit – 1 notes

their significance in managing computer resources

1. Security

Significance: Protects data and resources from unauthorized access, ensuring system integrity and user
privacy.

2. Networking

Significance: Facilitates communication between computers and devices, enabling resource sharing and
remote access.

3. Error Detection

Its significance includes:

1. System Stability
2. Data Integrity

4. Memory Management

Significance: Optimizes the use of physical memory, ensures data integrity, and prevents memory leaks,
allowing programs to run efficiently.
5. Process Management

Significance: Ensures efficient CPU utilization and enables multitasking, allowing multiple applications
to run simultaneously without interference.

6. Device Management

Significance: Ensures smooth communication between the system and peripheral devices (like printers,
keyboards, etc.), enabling proper functioning of all hardware components.

7. File Management

Significance: Provides a structured way to store data, ensuring data security and accessibility while
managing disk space effectively.

8. Job Accounting

Its significance includes:

1. Resource Utilization Monitoring


2. Performance Analysis

5. Illustrate the use of variables and quotes in unix shell scripting?

Refer Unit – 1 notes

6. Discuss the soft and hard links of Unix in brief ?

Refer Unit – 1 notes

7. Summarize the foreground and background jobs of job control?

Refer Unit – 1 notes

You might also like