Question

Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2....

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.

Homework Answers

Answer #1

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 :)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
How would I go about answering these questions In linux. Please provide the correct linux command...
How would I go about answering these questions In linux. Please provide the correct linux command needed to answer these 4 questions 5. Display total words of each file under your root directory and subdirectories. 6. Change permission of every filename ends “.py” to — write read execute, group - read execute, other - execute 7. Find every line which contains “hello” from your file system, display both file name, line number. 8. Combine files with name “p3.py”, “p31.py”, “p32.py”,...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may...
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Write a SED command that could replace all of the area codes that use parenthesis so that they are removed and replaced with a single dash like the others. Example: (222) 222-2222 should become 222-222-2222.
drwxr-xr-x 10 mst staff 320 Sep 18 14:58 Sites drwxr-xr-x 2 mst staff 64 May 28...
drwxr-xr-x 10 mst staff 320 Sep 18 14:58 Sites drwxr-xr-x 2 mst staff 64 May 28 2017 VirtualBox VMs -rw-r--r-- 1 mst staff 633 Dec 11 2019 balance.pl drwxr-xr-x 4 mst staff 128 Oct 11 2014 bin -rw-r--r-- 1 mst staff 473 Dec 13 2019 bitshift.py For this problem, we are mainly concerned with the set of access permissions, which appears at the beginning of the line for each file or directory. Directories have a "d" at the beginning of...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4 enter directory inlab4 create a new file named by reverse.c with the following contents and then close the file: /*reverse.c */ #include <stdio.h> reverse(char *before, char *after); main() { char str[100]; /*Buffer to hold reversed string */ reverse("cat", str); /*Reverse the string "cat" */ printf("reverse(\"cat\")=%s\n", str); /*Display result */ reverse("noon", str); /*Reverse the string "noon" */ printf("reverse(\"noon\")=%s\n", str); /*Display result */ } reverse(char *before,...
Part 1 Write a program where a child is created to execute command that tells you...
Part 1 Write a program where a child is created to execute command that tells you the date and time in Unix. Use ​execl(...)​. Note: you need to specify the full path of the file name that gives you date and time information. Announce the successful forking of child process by displaying its PID. Part 2 Write a program where a child is created to execute a command that shows all files (including hidden files) in a directory with information...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following...
1. Vim commands: a. How do you auto indent your program? b. Explain what the following commands do: dd, y3, p, :set cindent (1 pt) VIM exercises These exercises on the computer need to be repeated by each student in the pair. This is to ensure that both students understand how to get around in Linux!!! For this part of the lab, you will create a .vimrc file that will help you develop your C++ programs using VIM. First, we...
Bash script with branching and looping Part 1: 1. Create a variable called NAME and set...
Bash script with branching and looping Part 1: 1. Create a variable called NAME and set it equal to the empty string (NAME=””). Create a variable called NAME_LENGTH and set it equal to the length of your last name. Output the value of the NAME variable to show that it is empty. 2. Write a FOR loop that executes as many times as there are letters in your name (use the NAME_LENGTH variable in your condition). Use a CASE statement...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...