File and Text Manipulation Post author:Devendra Kumar Post published: Post comments:0 Comments 6. In Bash, which of the following commands can be used to view the contents of a document? Check all that apply. Answers lessgatdogcat 7. A Linux machine has the following files:apple.txtbanana.jpgchocolate.txtorange.txtWhat command can be used to search for the word "fruit" in the text files? Check all that apply. Answers find fruit apple.txt chocolate.txt orange.txtgrep fruit apple.txt chocolate.txt orange.txtgrep fruit *.txtfind fruit apple.txt chocolate.txt 8. In Bash, which of the following commands can be used to view a list of all files in the /home directory? Check all that apply. Answers ls -la /homels -l -a /homelist -a /homels -la ~ 9. A Linux machine has a file named "types_of_fish.txt". Which of the following commands can be used to append the word "trout" to the file contents? Answers echo trout > types_of_fish.txtecho trout < types_of_fish.txtecho trout >> types_of_fish.txtecho trout 2> types_of_fish.txt 10. Using a linux machine, which of the following commands can be used to list through a directory called /home/ben/Documents and search for the word "important" in the filenames in that directory? Answers ls /home/ben/Documents< grep importantls /home/ben/Documents >> grep importantls /home/ben/Documents > grep importantls /home/ben/Documents | grep important 11. Which command can be used on Windows CLI to see the first 10 lines of a file called “more_information.txt”? Answers ls more_information.txt -head 10less more_information.txt -head 10head more_information.txtcat more_information.txt -head 10 Previous Please Share This Share this content Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Devendra Kumar Project Management Apprentice at Google You Might Also Like Week 2 – Learn about online stores Week 4 – Utilizing resources and tools for project success – Shuffle Q/A 1 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.