MCA 1 ST SEMESTER - 2022 Linux & Shell Programming (MCA545) Assignment - 3 Name:-Shubham Babu
MCA 1 ST SEMESTER - 2022 Linux & Shell Programming (MCA545) Assignment - 3 Name:-Shubham Babu
Q1. To display first 10 .c files of your working directory and save into another directory
named C_directory?
Sol
CMD :- $ ls *.c | head -10 && cp `ls *.c | head -10` C_directory
Q 2. To display last 20 files of your working directory with line number?
Sol.
Q3. To display lines 5 to 9 from file emp.txt as you have created previously?
Sol.
OR
WE CAN ALSO USE( -f) and (-d)
OR
WE CAN ALSO USE( -f) and (-d)
Q 10. To convert the record into upper case , display and also save into another file?
Sol.
Q11. Write a shell script which reads the marks in five subjects, prints total marks,
percentage?
Sol.
Vi-Editor
OUTPUT ON TERMINAL
Q12. Write a shell script to read principal amount, rate of interest and time in year. Calculate
and print the value of simple interest?
Sol.
Vi-Editor
OUTPUT ON TERMINAL
Q13. Write a shell script to print date (dd-mm-yyyy), time (hh-mm-ss), the name of your
working shell and name of terminal with suitable message?
Sol.
Vi-Editor
OUTPUT ON TERMINAL
Q14. Write a shell script to read month name and year from user and print the calendar of the
given month and year?
Sol.
Vi-Editor
OUTPUT ON TERMINAL