0% found this document useful (0 votes)
37 views19 pages

MCSL-204 ENG (Jan 25 To July 25)

The document provides detailed step-by-step instructions for various tasks in Windows 10 and Linux, including user account management, file operations, system settings exploration, and command line usage. It covers tasks such as creating user accounts, managing files and folders, using Task Manager, and executing Linux commands for file permissions and basic arithmetic operations. Additionally, it includes scripts for compressing directories and performing calculations, making it a comprehensive guide for both Windows and Linux users.

Uploaded by

Muskan Rastogi
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
37 views19 pages

MCSL-204 ENG (Jan 25 To July 25)

The document provides detailed step-by-step instructions for various tasks in Windows 10 and Linux, including user account management, file operations, system settings exploration, and command line usage. It covers tasks such as creating user accounts, managing files and folders, using Task Manager, and executing Linux commands for file permissions and basic arithmetic operations. Additionally, it includes scripts for compressing directories and performing calculations, making it a comprehensive guide for both Windows and Linux users.

Uploaded by

Muskan Rastogi
Copyright
© © All Rights Reserved
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/ 19

IGNOU

LATEST ASSIGNMENT SOLUTION


Of
MCSL 204
WINDOWS and LINUX Lab
4|Page
MCSL 204
Pag e |5
MCSL 204

s
6|Page
MCSL 204

PART-I: Windows 10
Question 1: For the following given tasks of Windows 10, write the step-by-step
procedure as well as attach the main screen shots:
a. Create a new user account, set a password, and switch between accounts.
1. Create a New User Account:
o Open Settings by pressing Windows + I.
o Go to Accounts > Family & other users.
o Under Other users, click on Add someone else to this PC.
o Choose whether you want to add a Microsoft account or a local user. For a local
user, select I don’t have this person’s sign-in information, then Add a user
without a Microsoft account.
o Enter a name for the new user, set a password (optional), and click Next.
2. Switch Between Accounts:
o Press Ctrl + Alt + Del, then select Switch user.
o Choose the account you want to switch to.

b. Change the desktop wallpaper, screen resolution, and add/remove desktop icons.
1. Change Desktop Wallpaper:
o Right-click on the desktop and select Personalize.
o Under Background, choose a new wallpaper or browse to an image file on your
computer.
2. Change Screen Resolution:
o Go to Settings > System > Display.
o Under Display resolution, choose your desired resolution from the dropdown.
3. Add/Remove Desktop Icons:
o Right-click on the desktop and select Personalize.
o Under Themes, click on Desktop icon settings.
o From here, you can add or remove icons like Computer, Network, Recycle Bin,
etc.
Pag e |7
MCSL 204

c. Create, rename, move, and delete folders and files. Explore different views in File
Explorer.
1. Create a Folder:
o Right-click in a location, choose New > Folder.
o Name your folder.
2. Rename a Folder/File:
o Right-click the folder/file and select Rename.
o Type a new name and press Enter.
3. Move a Folder/File:
o Drag the folder/file to the desired location or right-click it and choose Cut,
navigate to the new location, right-click, and choose Paste.
4. Delete a Folder/File:
o Right-click and select Delete or select it and press Delete on the keyboard.
5. Explore Different Views in File Explorer:
o Open File Explorer and click on the View tab.
o Choose between options like Details, Icons, List, or Small icons.

d. Open Task Manager, view running processes, and end a task.


1. Open Task Manager:
o Right-click on the taskbar and select Task Manager, or press Ctrl + Shift + Esc.
2. View Running Processes:
o Go to the Processes tab to see all active processes.
3. End a Task:
o Right-click the task you want to end and click End Task.

e. Explore system settings using both the Control Panel and the Settings app.
1. Control Panel:
o Type Control Panel in the search bar and select it.

s
8|Page
MCSL 204

o Explore various sections like System and Security, Hardware and Sound, etc.
2. Settings App:
o Press Windows + I to open Settings.
o Navigate to various sections like Privacy, System, Devices, etc.

f. Compress a folder into a ZIP file and extract its contents.


1. Compress a Folder:
o Right-click the folder, select Send to, then click Compressed (zipped) folder.
2. Extract Contents:
o Right-click the ZIP file and select Extract All.

g. Use the search bar in File Explorer to find specific files based on keywords or
extensions.
1. Use the Search Bar:
o Open File Explorer.
o In the search bar at the top right, type your search term or use *.ext (e.g., *.jpg)
to search for files with a specific extension.

h. Change file or folder permissions and test access using different user accounts.
1. Change Permissions:
o Right-click the file/folder and select Properties.
o Go to the Security tab and click Edit to modify permissions for users.
2. Test Access:
o Log in as a different user account and try accessing the file/folder to verify
permissions.

i. Recover deleted files from the Recycle Bin and permanently delete items.
1. Recover Deleted Files:
o Double-click the Recycle Bin on the desktop.
Pag e |9
MCSL 204

o Right-click the file(s) and select Restore to recover them.


2. Permanently Delete:
o Right-click the file(s) and select Delete or press Shift + Delete to permanently
remove them.

j. View partition information and format a USB drive.


1. View Partition Information:
o Right-click the Start button and select Disk Management.
o View and manage your partitions here.
2. Format a USB Drive:
o Right-click the USB drive in Disk Management and select Format.

k. Create a system restore point and simulate restoring the system to a previous point.
1. Create a Restore Point:
o Search for Create a restore point in the Start menu.
o Under System Properties, click Create and follow the prompts.
2. Restore the System:
o Go to System Restore and select a restore point.
o Follow the instructions to restore the system to that point.

l. Capture a specific area of the screen and save it as an image file.


1. Capture Area of the Screen:
o Press Windows + Shift + S to open the Snipping Tool.
o Select the area you want to capture.
2. Save as an Image:
o After capturing, the screenshot will be copied to your clipboard. Open Paint,
paste the screenshot, and save it as an image file.

s
10 | P a g e
MCSL 204

m. Perform a quick scan and review the results.


1. Quick Scan:
o Open Windows Security by typing it into the search bar.
o Go to Virus & Threat Protection and click Quick Scan.
2. Review Results:
o The scan will show the results and any threats found.

n. Connect to a wireless network, forget a network, and reconnect.


1. Connect to a Wireless Network:
o Click on the Wi-Fi icon in the taskbar.
o Select your network and click Connect. Enter the password if required.
2. Forget a Network:
o Go to Settings > Network & Internet > Wi-Fi > Manage known networks.
o Select the network and click Forget.
3. Reconnect to a Network:
o From the Wi-Fi list, click on the network again and select Connect.

o. Use the command prompt to view and note the IP address using the ipconfig command.
1. Open Command Prompt:
o Press Windows + R, type cmd, and press Enter.
2. View IP Address:
o In Command Prompt, type ipconfig and press Enter.
o Your IP address will be displayed under IPv4 Address.

p. Play a video or audio file and create a playlist.


1. Play a File:
o Double-click on a video or audio file to open it in Windows Media Player or
Movies & TV.
P a g e | 11
MCSL 204

2. Create a Playlist:
o In Windows Media Player, go to the Library tab, click Create Playlist, and add
your files to it.

q. Enable and test features like the Magnifier, Narrator, and On-Screen Keyboard.
1. Enable Magnifier:
o Press Windows + Plus to open the Magnifier.
2. Enable Narrator:
o Press Ctrl + Win + Enter to turn on Narrator.
3. Enable On-Screen Keyboard:
o Go to Settings > Ease of Access > Keyboard, then toggle On-Screen
Keyboard.

r. Use the Display Calibration Wizard to adjust brightness and colors.


1. Open Display Calibration Wizard:
o Search for Calibrate display color in the Start menu.
o Follow the wizard to adjust colors and brightness.

s. Check for and install pending updates.


1. Check for Updates:
o Go to Settings > Update & Security > Windows Update.
o Click Check for updates.
2. Install Updates:
o If updates are available, click Install.

t. Use the Disk Cleanup tool to free up space on the C: drive.


1. Open Disk Cleanup:
o Type Disk Cleanup in the search bar and select it.

s
12 | P a g e
MCSL 204

o Select the C: drive and click OK.


2. Free Up Space:
o Check the types of files you want to delete (temporary files, system files, etc.)
and click OK, then Delete Files.

PART-II: LINUX
Question 1:
Write the LINUX commands for the following:
a. Set the permissions of exam.txt so that only the owner can read and write, and others
have no access.
chmod 600 exam.txt
This command sets the file exam.txt permissions so that the owner has read and write
permissions (rw-), while all others have no permissions (---).

b. Display the current permissions of exam.txt using ls -l.


ls -l exam.txt
This will display the permissions, owner, group, and other details of exam.txt.

c. Change the owner of exam.txt to another user using chown (if allowed).
sudo chown username exam.txt
Replace username with the name of the user to whom you want to transfer ownership of
exam.txt.

d. Grant read permission to a specific user using setfacl.


setfacl -m u:username:r exam.txt
Replace username with the name of the user. This command grants the specified user read (r)
permission on exam.txt.
P a g e | 13
MCSL 204

e. Use the wc command to count the number of lines, words, and characters in exam.txt.
wc exam.txt
This command will output three values: the number of lines, words, and characters in exam.txt.

f. Find all occurrences of a specific word (e.g., "Linux") in exam.txt using grep.
grep "Linux" exam.txt
This will search for the word "Linux" in exam.txt and display all matching lines.

g. Sort the lines of a file named data.txt alphabetically using sort.


sort data.txt
This command will output the lines of data.txt sorted alphabetically.

h. Remove duplicate lines from data.txt using uniq.


uniq data.txt
This command removes adjacent duplicate lines from data.txt and displays the result. To work
properly, the file needs to be sorted first. You can combine sort and uniq:
sort data.txt | uniq

i. Redirect the output of the ls command into a file named output.txt.


ls > output.txt
This command will list the contents of the current directory and redirect the output into
output.txt.

j. Check the connectivity to a specific website (e.g., google.com) using ping.


ping google.com
This will send ICMP echo requests to google.com and display the results, allowing you to
check connectivity.

s
14 | P a g e
MCSL 204

Question 2:
a. Write a script to display numbers from 1 to 10 using a for loop.
Here is a simple shell script that uses a for loop to display numbers from 1 to 10:
#!/bin/bash

# Script to display numbers from 1 to 10


for i in {1..10}
do
echo $i
done
Explanation:
1. #!/bin/bash: This is the shebang line which tells the system that the script should be run
using the Bash shell.
2. for i in {1..10}: This sets up a loop that iterates from 1 to 10.
3. echo $i: This prints the current value of i in each iteration of the loop.
How to use:
1. Save the script to a file, for example, display_numbers.sh.
2. Make the script executable by running:
chmod +x display_numbers.sh
3. Run the script by typing:
./display_numbers.sh
This will display numbers from 1 to 10.

b. Write a script to compress a directory (e.g., ~/exam) into a .tar.gz file.


#!/bin/bash

# Script to compress the ~/exam directory into a .tar.gz file


P a g e | 15
MCSL 204

# Define the source directory and the output file


SOURCE_DIR=~/exam
OUTPUT_FILE=~/exam.tar.gz

# Check if the directory exists


if [ -d "$SOURCE_DIR" ]; then
# Compress the directory into a .tar.gz file
tar -czvf $OUTPUT_FILE $SOURCE_DIR
echo "Directory $SOURCE_DIR has been compressed into $OUTPUT_FILE"
else
echo "Directory $SOURCE_DIR does not exist."
Fi
Explanation:
1. #!/bin/bash: This is the shebang line indicating that the script should be executed with
the Bash shell.
2. SOURCE_DIR=~/exam: This defines the source directory (~/exam) that you want to
compress.
3. OUTPUT_FILE=~/exam.tar.gz: This defines the output file name (~/exam.tar.gz).
4. if [ -d "$SOURCE_DIR" ]; then: This checks if the source directory exists.
5. tar -czvf $OUTPUT_FILE $SOURCE_DIR: This command compresses the directory
into a .tar.gz file:
o c: Create a new archive.
o z: Compress the archive using gzip.
o v: Verbose mode (lists the files being archived).
o f: Specifies the file name of the archive.
6. echo "Directory $SOURCE_DIR has been compressed into $OUTPUT_FILE": This
prints a success message.
7. If the directory does not exist, it will print an error message.

s
16 | P a g e
MCSL 204

How to use:
1. Save the script to a file, for example, compress_directory.sh.
2. Make the script executable by running:
chmod +x compress_directory.sh
3. Run the script by typing:
./compress_directory.sh
This will compress the ~/exam directory into a .tar.gz file located in your home directory
(~/exam.tar.gz).

c. Create a script that takes user input from the menu displayed and performs the
arithmetic operation like a simple calculator.
#!/bin/bash

# Simple calculator script

# Function for addition


add() {
echo "Enter two numbers to add:"
read num1
read num2
result=$((num1 + num2))
echo "The result of addition is: $result"
}

# Function for subtraction


subtract() {
echo "Enter two numbers to subtract:"
read num1
P a g e | 17
MCSL 204

read num2
result=$((num1 - num2))
echo "The result of subtraction is: $result"
}

# Function for multiplication


multiply() {
echo "Enter two numbers to multiply:"
read num1
read num2
result=$((num1 * num2))
echo "The result of multiplication is: $result"
}

# Function for division


divide() {
echo "Enter two numbers to divide:"
read num1
read num2
if [ $num2 -eq 0 ]; then
echo "Error: Division by zero is not allowed."
else
result=$((num1 / num2))
echo "The result of division is: $result"
fi
}

# Function to display the menu


s
18 | P a g e
MCSL 204

menu() {
echo "Simple Calculator Menu"
echo "1. Add"
echo "2. Subtract"
echo "3. Multiply"
echo "4. Divide"
echo "5. Exit"
echo "Please select an operation (1-5):"
read choice
case $choice in
1) add ;;
2) subtract ;;
3) multiply ;;
4) divide ;;
5) echo "Exiting the calculator. Goodbye!"; exit 0 ;;
*) echo "Invalid option. Please choose a valid option."; menu ;;
esac
}

# Main loop to keep showing the menu


while true; do
menu
done
Explanation:
1. Functions:
o add(): This function takes two numbers as input and adds them.
o subtract(): This function subtracts two numbers.
o multiply(): This function multiplies two numbers.
P a g e | 19
MCSL 204

o divide(): This function divides two numbers, with a check to ensure that division
by zero doesn't occur.
2. Menu:
o The menu() function displays a list of options (Add, Subtract, Multiply, Divide,
Exit).
o The script reads the user's choice and calls the corresponding function based on
that input.
3. Main Loop:
o The while true loop keeps displaying the menu until the user chooses to exit by
selecting option 5.
How to use:
1. Save the script to a file, for example, simple_calculator.sh.
2. Make the script executable by running:
chmod +x simple_calculator.sh
3. Run the script by typing:
./simple_calculator.sh
The script will then display the menu and prompt the user to enter the desired operation. It will
continue to run until the user selects "Exit" from the menu.

d. Write a script to back up a directory into a compressed archive.


#!/bin/bash

# Backup script to compress a directory into a .tar.gz file

# Function to backup the directory


backup_directory() {
echo "Enter the directory to back up:"
read source_dir

s
20 | P a g e
MCSL 204

# Check if the directory exists


if [ ! -d "$source_dir" ]; then
echo "Error: Directory $source_dir does not exist."
exit 1
fi

# Get the current date to append to the backup filename


current_date=$(date +"%Y-%m-%d_%H-%M-%S")

# Define the backup archive name


backup_file="${source_dir}_backup_$current_date.tar.gz"

# Compress the directory into a .tar.gz file


tar -czvf "$backup_file" "$source_dir"

# Inform the user that the backup was successful


if [ $? -eq 0 ]; then
echo "Backup successful! The backup file is $backup_file."
else
echo "Error: Backup failed."
fi
}

# Run the backup function


backup_directory
P a g e | 21
MCSL 204

Explanation:
1. Directory Selection:
o The script prompts the user to input the directory they want to back up using the
read command.
2. Directory Existence Check:
o The script checks whether the specified directory exists using if [ ! -d
"$source_dir" ]. If the directory does not exist, it exits with an error message.
3. Current Date for Backup Filename:
o The script uses the date command to generate a timestamp (e.g., 2025-02-26_14-
30-00) to ensure that each backup has a unique filename.
4. Creating the Compressed Archive:
o The tar command is used to compress the specified directory into a .tar.gz file:
▪ c: Create a new archive.
▪ z: Compress using gzip.
▪ v: Verbose mode (show the files being archived).
▪ f: Specify the file name for the archive.
5. Completion Message:
o If the backup is successful ($? -eq 0), the script prints a success message with the
backup file name. Otherwise, it prints an error message.
How to Use:
1. Save the script to a file, for example, backup_directory.sh.
2. Make the script executable:
chmod +x backup_directory.sh
3. Run the script:
./backup_directory.sh
The script will prompt you to enter the path of the directory you want to back up. It will then
create a compressed .tar.gz archive with the backup, appending the current date and time to
the filename.
For example, if you backup a directory named ~/exam, the archive might be named
~/exam_backup_2025-02-26_14-30-00.tar.gz.
s

You might also like