Monday, 30 September 2024

What is Linux ? Why Linux? lab

 

What is Linux?

Linux is a family of open-source operating systems that are based on the Linux kernel. Unlike proprietary operating systems like Windows and macOS, Linux is freely available and modifiable. This openness has led to a vast ecosystem of distributions, each with its unique set of features and target users.

Why Choose Linux?

There are numerous reasons why people choose Linux:

  • Cost: Linux is free.
  • Security: Linux is generally considered more secure than other operating systems due to its open-source nature and active community.
  • Customization: Linux offers a high degree of customization, allowing users to tailor their system to their specific needs.
  • Stability: Linux is known for its stability and reliability.
  • Performance: Linux often performs better than other operating systems, especially on older hardware.
  • Community: Linux has a large and supportive community that provides a wealth of resources and assistance.

Step-by-Step Linux Labs with Screenshots

Note: To follow these labs, you'll need a computer with Linux installed. If you don't have one, you can try a virtual machine or a live CD/USB distribution.

Lab 1: Basic Commands

  1. Open a terminal: This is the command-line interface for Linux.
    Image of Linux terminal
  2. Print a message: Use the echo command to display a message.
Bash
echo "Hello, world!"

[Image of the output of the echo command] 3. List files and directories: Use the ls command to list the contents of the current directory.

Bash
ls

[Image of the output of the ls command] 4. Create a directory: Use the mkdir command to create a new directory.

Bash
mkdir new_directory
  1. Change directories: Use the cd command to navigate to a different directory.
Bash
cd new_directory

Lab 2: Package Management

  1. Install a package: Use the package manager (e.g., apt for Debian-based distributions, yum for RPM-based distributions) to install a new package.
Bash
sudo apt install gedit

2. Remove a package: Use the package manager to remove an existing package.

Image of package installation process

Bash
sudo apt remove gedit
  1. Update package lists: Use the package manager to update the list of available packages.
Bash
sudo apt update

Lab 3: User Management

  1. Create a new user: Use the adduser command to create a new user.
Bash
sudo adduser newuser
  1. Set a password: Use the passwd command to set a password for the new user.
Bash
sudo passwd newuser
  1. Switch to the new user: Use the su command to switch to the new user.
Bash
su newuser

Lab 4: File System Operations

  1. Copy a file: Use the cp command to copy a file.
Bash
cp important_file.txt backup.txt
  1. Move a file: Use the mv command to move a file.
Bash
mv old_file.txt new_file.txt
  1. Delete a file: Use the rm command to delete a file.
Bash
rm unwanted_file.txt

No comments:

Post a Comment