Write Linux command for each question. Please use one single commend to do
following process.
Q1: Display all lines of list1.txt and list2.txt containing the letter ‘p', and sort the result.
Q2: Append “file1.txt” and “file2.txt”, and redirect to “file3.txt”.
Q3: Sort “file3.txt”, and redirect the result to file “file4.txt”
Q4: Use shorthand way to change the permission of “file3.txt” to “user - write read
execute, group - read execute, other - execute”.
Q5: Extract first column from “file3.txt”, and redirect to “file5.txt”.
Q6: Extract second and third column from “file4.txt”, and append result to “file5.txt”.
Q7: Replace all “20” to “200” in “file5.txt”, and redirect result to “table7.txt”.
Q8: Remove all duplicate lines from “file4.txt”, and redirect the result to “file8.txt”.
Q9: Display sorted filename in the current path.
Q10: Redirect sorted filename in the current path to “file9.txt
It only needs to be the command to as if there was information in the files. So write only the command.
Linux Commands
1.sort grep -h p list1.txt list2.txt
In the above command grep is a filter used to search a file for particular pattern. -h for finding pattern , p is the pattern and list1 and list2 are file name. sort used for sorting.
2. cat file1.txt file2.txt >> file3.txt
3. sort file3.txt > file4.txt
4. chmod 751 file3.txt
5. cut -c 1 file3.txt > file5.txt
6. cut -c 2,3 file4,txt >> file5.txt
7. sed 's/20/200/g' file5.txt >table7.txt
8. uniq file4.txt > file8.txt
9. ls -1 | sort
10. ls -1 | sort > file9.txt
SUMMARY: chmod used for permission i.e, access mode of a file. cut is used to cut particular field or column , In the above q 5 & 6 uses cut for columns cut .sed used to replace i.e, called as Stream Editor. uniq is used to filter reapeated lines. sort used for sorting purpose. cat is used for concatination. > can be used for redirection and >> for appending purpose.
Q1: grep "p" list1.txt list2.txt | sort
Q2: cat file1.txt file2.txt >> file3.txt
Q3: sort file3.txt > file4.txt
Q4: chmod u=rwx,g=rx,o=x file3.txt
Q5: cut -f1 file3.txt > file5.txt
Q6: cut -f2,3 file4.txt >> file5.txt
Q7: sed 's/20/200/g' file5.txt > table7.txt
Q8: sort -u file4.txt > file8.txt
Q9: ls | sort
Q10: ls | sort > file9.txt
Write Linux command for each question. Please use one single commend to do following process. Q1:...
Question I This question carries 20% of the marks for this assignment. You are asked to develop a set of bash shell script: Write a script that asks for the user's salary per month. If it is less or equals to 800, print a message saying that you need to get another job to increase your income, what you earn is the Minim living cost. If the user's salary is higher than 800 and below 2000, print a message telling...
Please try to write the code with Project 1,2 and 3 in
mind. And use java language, thank you very much.
Create an Edit Menu in your GUI
Add a second menu to the GUI called Edit which will have one
menu item called Search. Clicking on search should prompt the user
using a JOptionPane input dialog to enter a car make. The GUI
should then display only cars of that make. You will need to write
a second menu...