View the content of a file and display line numbers.
Change the access permissions of files to make them readable, writable, and executable by the owner only.
Check the last 10 commands you have run.
Remove a directory and all its contents.
Create a
fruits.txt
file, add content (one fruit per line), and display the content.Add content in
devops.txt
(one in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. Then, append "Pineapple" to the end of the file.Show the first three fruits from the file in reverse order.
Show the bottom three fruits from the file, and then sort them alphabetically.
Create another file
Colors.txt
, add content (one color per line), and display the content.Add content in
Colors.txt
(one in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey. Then, prepend "Yellow" to the beginning of the file.Find and display the lines that are common between
fruits.txt
andColors.txt
.Count the number of lines, words, and characters in both
fruits.txt
andColors.txt
.
ย