WorksheetsLinux - Up to Disk Partition
Total questions: 50
Worksheet time: 25mins
Which command is used to display information about the Linux operating system?
`osinfo`
`uname`
`sysinfo`
`lsb_release`
What is the core component of the Linux operating system?
Shell
Kernel
File system
Command interpreter
Which command is used to initiate a Linux session?
`startx`
`reboot`
`login`
`halt`
How do you terminate a Linux session?
`logout`
`exit`
`terminate`
`close`
Which version of CentOS is widely used for server environments?
CentOS 5
CentOS 6
CentOS 7
CentOS Stream
What is the file extension of a compressed file created using `gzip`?
.tar
.gz
.bz2
.zip
Which command is used to create an archive of files in Linux?
`tar`
`gzip`
`zip`
`unzip`
Which command decompresses a `.bz2` file?
`tar`
`bzip2`
`bunzip2`
`gunzip`
What is the topmost directory in the Linux file system hierarchy?
/bin
/root
/
/home
Which command is used to navigate to the parent directory in Linux?
cd /
cd ..
cd -
cd ~
How do you list all files, including hidden files, in a directory?
`ls`
`ls -a`
`ls -l`
`dir`
Which command is used to copy files in Linux?
`mv`
`cp`
`cut`
`copy`
Which command is used to change the ownership of a file?
`chmod`
`chown`
`chgrp`
`passwd`
What permission does `chmod 755` grant to the owner of a file?
Read and write
Read, write, and execute
Read and execute
Write and execute
Which text editor is most commonly used in command-line environments?
Notepad
Nano
Vim
Gedit
Which command is used to start editing a file in Vim?
`start`
`edit`
`vi`
`open`
How do you save and exit a file in Vim?
:q
:wq
:save
:exit
Which text editor is known for its simplicity in Linux?
Nano
Vim
Gedit
Emacs
How many types of user accounts exist in Linux?
One
Two
Three
Four
What does the `>` operator do in Linux?
Redirects output to another file
Redirects input to another file
Pipes output to a command
Displays error messages
Which command is used to concatenate and display file content?
`ls`
`cat`
`touch`
`grep`
What is the function of the pipe (`|`) operator?
Combines files
Filters input
Passes output of one command as input to another
Creates new directories
Which command filters content based on a pattern?
`cat`
`grep`
`awk`
`sed`
Which file represents the standard output in Linux?
/dev/null
/dev/stdin
/dev/stdout
/dev/stderr
Which command displays the partition table of a disk?
`lsblk`
`fdisk`
`parted`
`blkid`
What is the maximum number of primary partitions a disk can have?
Two
Four
Eight
Unlimited
Which type of partition can extend primary partitions?
Logical
Physical
Swap
Primary
What is the purpose of LVM in Linux?
Increase disk speed
Simplify disk management
Create backups
Compress files
Which command initializes a physical volume for LVM?
`pvscan`
`pvcreate`
`vgcreate`
`lvcreate`
Which command is used to create an LVM volume group?
`vgscan`
`lvcreate`
`vgcreate`
`pvcreate`
How do you mount a partition in Linux?
`lsblk`
`mount`
`fdisk`
`blkid`
Which command displays the amount of free disk space?
`df`
`du`
`lsblk`
`free`
Which file contains information about mounted file systems?
/etc/fstab
/etc/mount
/etc/mtab
/etc/filesystems
Which command compresses files using `gzip`?
`compress`
`gzip`
`tar`
`zip`
What is the default file extension for a `tar` archive?
.tar
.gz
.bz2
.zip
Which command extracts `.tar.gz` files?
`gzip`
`tar -xzf`
`bzip2`
`zip`
Which directory contains device files in Linux?
/var
/etc
/dev
/proc
What does the `/dev/null` file do?
Stores logs
Deletes unwanted output
Acts as a temporary directory
Stores kernel files
Which command displays a file with line numbers?
`grep`
`nl`
`cat`
`awk`
Which command searches for patterns in text files?
`sed`
`grep`
`awk`
`find`
Which command creates an empty file?
`touch`
`mkdir`
`rm`
`cp`
What is the function of the `man` command?
Creates manual pages
Displays manual pages
Opens files
Executes programs
Which command shows the current directory path?
`ls`
`pwd`
`cd`
`locate`
Which type of file stores executable code?
Text file
Directory
Binary file
Configuration file
What is the function of the `chmod` command?
Change user ownership
Modify file permissions
Copy files
Rename directories
If a Directory is not empty, can we remove it using `rmdir`
YES
NO
What does the `chmod 644` command do?
Grants read and write permissions to the owner, and read permissions to the group and others
Grants read, write, and execute permissions to the owner
Grants read permissions to everyone
Grants write permissions to the group
Which command is used to display the current working directory?
`pwd`
`cd`
`ls`
`dir`
You are a system administrator managing a shared server for a development team. The team needs access to a project directory (/home/projects/dev) where they can create and edit files collaboratively. However, the files should not be readable or writable by any other users outside the group.
Question:
Which commands will you use to set the appropriate permissions and ownership for the dev directory?
chown developer:devgroup /home/projects/dev; chmod 755 /home/projects/dev
chown developer:devgroup /home/projects/dev; chmod 770 /home/projects/dev
chown root:root /home/projects/dev; chmod 777 /home/projects/dev
chown admin:users /home/projects/dev; chmod 755 /home/projects/dev
Your company’s server is running out of storage, and you have added a new hard disk to the system. You need to create a new partition on the disk, format it with the ext4 file system, and mount it to /data.
Question:
What sequence of commands will you use to perform this task?
fdisk /dev/sdb; mkfs.ext4 /dev/sdb1; mount /dev/sdb1 /data
parted /dev/sdb; mkfs.ext3 /dev/sdb1; mount /dev/sdb1 /mnt/data
fdisk /dev/sdb; mkfs.xfs /dev/sdb; mount /dev/sdb /data
mkpart /dev/sdb; mkfs.ext4 /dev/sdb1; umount /data
