- Basic Commands
- Task 1: Write commands to navigate to your home directory and list all files and directories.
- Expected Output:
Contents of Home Directory: Desktop Documents Downloads Music Pictures Videos
- Task 2: Write commands to create a directory named
Assignment1
in your home directory and navigate into it.- Expected Output:
Directory 'Assignment1' created. Current directory: /home/user/Assignment1
- Task 3: Write commands to create a file named
file1.txt
and write “Hello, Linux!” into it.- Expected Output:
File 'file1.txt' created with content: Hello, Linux!
- Task 4: Write commands to rename
file1.txt
tonewfile.txt
.- Expected Output:
File 'file1.txt' renamed to 'newfile.txt'.
- Task 5: Write commands to delete the file
newfile.txt
.- Expected Output:
File 'newfile.txt' deleted.
- Expected Output:
- File Permissions and Ownership
- Task 6: Write commands to display the permissions of a file
example.txt
and change its permissions to read-only for all users.- Expected Output:
Current permissions of 'example.txt': -rw-r--r-- Permissions changed to read-only for all users.
- Task 7: Write commands to change the ownership of a file
example.txt
to userjohn
and groupusers
.- Expected Output:
Ownership of 'example.txt' changed to user: john, group: users.
- Expected Output:
- Processes and Jobs
- Task 8: Write commands to display all running processes.
- Expected Output: (Sample output with process details)
- Task 9: Write commands to find and kill a process named
firefox
.- Expected Output:
Process 'firefox' killed.
- Task 10: Write commands to run a command
ls -l
in the background and list all background jobs.- Expected Output:
Command 'ls -l' running in background. Background jobs: [1]+ Running ls -l &
- Expected Output:
- File System Navigation and Manipulation
- Task 11: Write commands to navigate to the root directory and list all files and directories.
- Expected Output:
Contents of Root Directory: bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
- Task 12: Write commands to create a symbolic link named
link1
pointing to a filefile2.txt
.- Expected Output:
Symbolic link 'link1' created pointing to 'file2.txt'.
- Task 13: Write commands to compress a directory
Folder1
into aFolder1.tar.gz
archive.- Expected Output:
Directory 'Folder1' compressed into 'Folder1.tar.gz'.
- Task 14: Write commands to extract contents from
Folder1.tar.gz
into a directory namedExtracted
.- Expected Output:
Contents extracted from 'Folder1.tar.gz' into 'Extracted' directory.
- Expected Output:
- Networking
- Task 15: Write commands to display network interfaces and their IP addresses.
- Expected Output: (Sample output with interface details)
- Task 16: Write commands to ping
google.com
and display the result.- Expected Output: (Sample output showing ping statistics)
- Task 17: Write commands to display the contents of
/etc/hosts
file.- Expected Output: (Contents of
/etc/hosts
file)
- Expected Output: (Contents of
- Shell Scripting
- Task 18: Write a shell script to accept a number as input and display its factorial.
- Expected Output: (Sample output showing factorial calculation)
- Task 19: Write a shell script to accept a filename as input and check if it exists in the current directory.
- Expected Output: (Sample output indicating file existence)
- Task 20: Write a shell script to list all
.txt
files in the current directory and count them.- Expected Output: (Sample output showing list of
.txt
files and count)
- Expected Output: (Sample output showing list of
Latest posts by Mahesh Wabale (see all)
- Deployment of vault HA using MySQL - September 18, 2024
- Sending slack notification via pipeline job - August 25, 2024
- SonarQube integration with Jenkins - August 24, 2024