0% found this document useful (0 votes)
37 views

Basic Linux Command Test

This document contains questions about common Linux commands and operations: 1. It asks how to read the contents of multiple files in one command, display the present working directory, switch between paths, copy multiple files to a directory, display the first 5 lines of a file, print the second last line of a file, delete all files in the current directory, count files in the current directory, display subdirectories, search for a string in files, replace a string, switch to insert mode in vi, count a string in a file, find a file from the root directory, save and quit vi, get line and word counts from a file, search multiple patterns in a file with one command, explain the differences between find and grep

Uploaded by

vikassharma9863
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Basic Linux Command Test

This document contains questions about common Linux commands and operations: 1. It asks how to read the contents of multiple files in one command, display the present working directory, switch between paths, copy multiple files to a directory, display the first 5 lines of a file, print the second last line of a file, delete all files in the current directory, count files in the current directory, display subdirectories, search for a string in files, replace a string, switch to insert mode in vi, count a string in a file, find a file from the root directory, save and quit vi, get line and word counts from a file, search multiple patterns in a file with one command, explain the differences between find and grep

Uploaded by

vikassharma9863
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1- How to read the content of multiple files in one command ?

2- How to create the empty files?

3- how to display the present working directory?

4- how to Switch from current path to previous path?

5- how to Coping multiple files into a directory?

6- how to displays the first 5 lines from the file?

7- how to print only 2nd last line from a file?

8- how to delete all files in the current directory?

9- how to Count total no of files in the current directory?

10-how to Display all subdirectories in the current directory?

11- How to print those lines which contain “unix” word ?

12- How can replace a string in unix?

13- How to switch to insert mode in vi editor?

14- How to count a string in a file(filename=file.txt,string=Shinning)?

15- how to find a file from root directory.(filename = file.txt)?


16- how to save and quit from vi Editors?

17- The Sample.txt file contain 100 lines and 300 words, write a Linux command to get the
following?
Number of lines in the sample file. ---
Number of 'the' word in the sample file. ----

18- How to search multiple patterns(e.g. oracle, Hadoop, mysql) in a text file. Please write a
single command.

19. What is the difference between find and grep command ?

20. what is the difference between vi and touch command ?

21. How to delete 3rd line in a file ?

22. How to print 2nd, and 3rd field from a file ?

23. How to identify 15 days old files and delete them in single command ?

24. What is the use of date, cal, whoami, pwd, cd, mkdir, cut, and sort commands ?

You might also like