Write Linux command lines to do the following:
1. Create a directory with name “yourName_ID”
2. Create a file with name “yourLastName.txt” inside the directory created in step.1
3. Write inside the created file exactly the following content (you may use editors such as vim, pico, ….): Linux Lab Lab. ToDo#1 Summer Semester 2019/2020#
4. Display the first 2 lines of the file.
5. Change the permission of the file to read write and execute for owner, groups and others.
6. Combine all lines in one line, separate lines with “-” character. Show your result only on standard output.
7. Replace word Lab to LAB for all matches.
8. Search for the lines that does not end with the character “.” or “#”
9. Search for the lines that contains a sequence of minimum 2 numbers and maximum 5 numbers.
10. Replace the space character with the “-” character for the output of date command.
assumed your id is : abc_123
assumed last name : xyz
Step 1
*******
mkdir abc_123
Step 2
********
cd abc_123
touch xyz.txt
Step 3
*********
Linux Lab Lab.
ToDo#1 Summer Semester 2019/2020#
Step 4
********
head -n 2 xyz.txt
Step 5
*********
chmod 777 xyz.txt
Step 6
********
cat xyz.txt | awk '{print}' ORS='" '
Step 7
********
sed 's/Lab/LAB/g' xyz.txt
Step 8
***********
grep -E '.' xyz.txt | grep -E '#'
Step 9
**********
grep -E '[0-9]{2}' xyz.txt | grep -E '[0-9]{5}'
Step 10
*********
date | sed 's/ /-/g'
Step 10
************
if you have any doubt then please ask me without any hesitation in
the comment section below , if you like my answer then please
thumbs up for the answer , before giving thumbs down please discuss
the question it may possible that we may understand the question
different way and i can edit and change the answers if you argue,
thanks :)
Get Answers For Free
Most questions answered within 1 hours.