Starting from:

$30

COL100 Assignment 1 -Solved


A. List any 6 commands used in the shell. 
B. Set up and explore the nano editor (A Linux command line editor) and write the 
command for the following: 
a. Move to the beginning of the line 
b. Move to the end of the line. 
c. Move back one page 
d. Save the file. 
e. To search the word. 
f. Cut and paste the text. 
g. Exit nano. 
For documentation of nano, please refer here. 
Q2. This question is based on Manipulating directory structures
A. Display the absolute path of your home directory. 
B. Create a new subdirectory called COL100_Assignments in your home directory. 
C. Create a new subdirectory called Assignment1 in COL100_Assignments. 
D. Create a new subdirectory called Assignment2 in COL100_Assignments. 
E. Display the contents of the directory COL100_Assignments. 
F. Delete the directory Assignment2. 
G. Display the contents of the directory COL100_Assignments. 
Q3. This question will familiarize you with manipulating. 
a. Change your working directory to COL100_Assignments 
b. Again create a subdirectory called Assignment2 in COL100_Assignments. Inside the 
Assignment2 subdirectory, create a new file called `myFile.txt`. Insert any two random 
lines in `myFile.txt`. 
c. Display the contents of `myFile.txt` to the shell. 
d. Now with `Assignment2` as your working directory, copy the file `myFile.txt` to the 
subdirectory `Assignment1` that you created in Q1. Rename the newly copied 
`myFile.txt` in subdirectory `Assignment1` to `File_1.txt`. 
e. Now make a copy of `File_1.txt` with the name `File_2.txt` in the same subdirectory 
`Assignment1`.f. Display the contents of the directory `COL100_Assignments`, `Assignment1` and 
`Assignment2`. 
g. Copy `File_2.txt` to `Assignment1`. 
h. List the contents of `Assignment1` 
i. 
Rename the directory `Assignment1` to `Assignment_1` 
j. 
List the contents of `Assignment_1` 
k. Now delete the entire subdirectory `Assignment_1` 
l. 
Display the contents inside `Assignment2`. 
Q.4 This question is based on Manipulating files using Wildcards. (10 marks) 
a. First of all make a new directory named COL100_Assignments.(Stay in this directory for 
the rest of the steps in question 4) 
b. Now make a new directory named Assignment1. 
c. Create 10 new files (in directory COL100_Assignments) named as follows: 
Test_1.txt, Test_2.txt, Test_1-1.txt, Test_2-1.txt, Test_1-2.txt, Test_2-2.txt, Test_1-1.bak, 
Test_2-2.bak, File_1.bat, File_2.bat. 
d. Display the listing of all the files in the current working directory. 
e. Display a listing of all the files ending in txt using one command. 
f. Display a listing of all the files ending in t using one command. 
g. Copy all the files containing "t_1" to the directory Assignment1 using one command. 
h. Display a listing of the contents of the directory Assignment1. 
Resources - 
1. https://www.unixtutorial.org/basic-unix-commands 
2. https://studentnet.cs.manchester.ac.uk/ugt/year1/linux-intro/notes/unix-node2.html

More products