Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

NAME:SARAH OBAIKWA

REGNO:P101/0949G/19

CAT1:

1. What is a file system? Compare the factors file system of windows and Unix.[5 marks]

File system- is a method that the operating system uses to control how data is stored and
accessed.

In Unix you can have two files with the same name in the same directory while in windows ,you
cannot have different files with the same name in the same folder.

In windows files are normally stored in folders on different data drives like C ,D while in Linux
files are usually ordered in a tree structure starting with the root directory.

Unix runs faster even with older hardware while windows are slower compared to Unix

In Unix you would find the system and program files in different directories whereas in windows
system and program files are usually saved in the same directory

Both Unix and windows can run several different types of web services.

Both windows and Unix have pretty good security; windows has access control lists on its NTFS
file system ,but Unix uses Read/Write/Execute bits by default instead

Both windows and Unix have file systems that can be corrupted

Both windows and Unix have anti-virus software.

2. Write a shell script called leap test that prompts a user to enter the year in 4

digits and test if the year is leap or not (a leap year is divisible by 4) [5marks]
3. Write a shell script that prints the following output [8marks]

10

210

3210

43210
4. Explain what the following commands does in Linux

i.df [1 mark]

It defines the number of blocks used ,available and the directory where the file system is
mounted.

ii.uname [1 mark]

used to determine the processor architecture, the system hostname and the version of the kernel
running on the system.

iii.gzip [1mark]

Is used to compress the files in order to reduce the file space.

5. Initialize your first name as a string and do the following. [6marks]

firstname= “sarah”

i)Write a script statement to display the length of your name.


echo ${#firstname}

ii)Write a script statement to display the first two characters of your name.

echo $firstname |cut -c1-2

iii)Write a script statement display your name

echo $firstname
6. State the function of the file /etc/shadow as used in Linux user management [3 marks]

/etc/shadow file stores actual password in encrypted format more like the hash of the password
for user's account with additional properties related to user password.

You might also like