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

Linux Commands

Uploaded by

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

Linux Commands

Uploaded by

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

Linux Commands

1.How you list all the files?

2.How you will copy file from other directory to your present working directory?

3.How you will link and unlink files?

4.How to display data without using vim editor?

5.How to display first 10 lines and last 10 lines in a file?


6.How to print a matching words in a file?

7.How to print matching word “pvpl” in a 10 files with .txt extension at a same time?

8.How to create multiple directories at a time?

9.How you will check disk space and memory space?


10 How to print data after a matching a word before and after three lines?

11.How you kill background running jobs?


“ps” after type “top”, then kill -9 <PID>

12.How to make shortcuts for the command give example?


13.How you will check difference between two files?

14.How to print first two column in a file?

15.How to print the rows from two to sixth in a file?

16.How to print third and ninth rows in a file?


17.How to print first and third column in a file?

18.Replace prime with vlsi in first 10 lines in a file?

19.Delete first to tenth rows in a file?


20.Replace prime with vlsi in a seventh row?

21.Replace “prime” with “vlsi” in a entire file?

22.Replace “prime” with “vlsi”, “icc2” with “starRC” and “DC” with “tempus” at a time in a file?
23.Append three files data into a single file in a same directory?

24.Convert text file into a .gz format?

25.How to open a file with .html extension?


Ans: firefox <filename.html>
26.How to open a file with .gz extension?
Ans: zless <filename.gz> or zmore<filename.gz>

27.How to open a new tab and new terminal?


Ctrl+shift+t = new tab
Ctrl+shift+n=new terminal

28.How to print all the best?

29.How to print unmatched data in a file?


30.How to print data from bottom to top?

31.How to change the permissions?

32.How you will delete the history?

33.Take a file with 10 lines and replace “prime” with “vlsi” in first five lines and replace “vlsi” with “prime” in last
five lines?
34.How to convert rows into columns?

35.How to convert columns into rows?

36.how you will delete directory which have 10 files or not empty?
37.How you will print all the unique lines in a file?

38.Print row 5th, row 6th ,row 9th and row 11th ?

39.How to print all the even rows in a file?

40. How to print all the odd rows in a file?


41.Time period of clockA is 1.3ns, clockB 1.7ns, clockC 2.7ns .Find its frequency?

42. A B
slack 1 -2ns
slack 2 -0.8ns
slack 3 -1.2ns
slack 4 -1ns
slack 5 -1.1ns
slack 6 -3.2ns
Print all the slack values which is greater than -1.1ns?

43.Write a script to print error count, warning count, PTE-075, LNK-005, LNK-006 in a file?

44. 44.From below question, print all the slack values which is greater than -1.1ns?
File handling questions
After opening a file
1. How you will highlight a word pvpl?
:/pvpl
:set hls
2. Give numbers

3. Go to last line of a file


Shift+g
4. Go to first line of a file
gg

5.Go to the end of the line


Shift+4 or $

6.Highlight prime and vlsi at a time


:/\vprime|vlsi
7.Delete all the highted lines?
g//d

8.Delete all unhighlighted lines?


v//d

9.Remove spaces between lines?


:%s/ //g
10.Print all the lines with matching pvpl?

:%! Grep “pvpl”

11.Replace pvpl with prime?


:%! Sed ‘s/pvpl/prime/’

12.print 2nd and 3rd column?


:%! Awk ‘{print $2,$3}’

13.Split the screen?


:split or sp- for horizontal split or vspl- for vertical split
14. Add # starting of each line?
:%s/^/#/

15.Remove # at starting of each line?


:%s/#//g

16. Copy 2nd row and paste


Place cursor at 2nd row and type “yy” to copy and where you want to paste place the cursor and type “p”
for paste.

17.Delete 2nd ,3rd and 4th rows


:2,3,4d
18.Print 2nd and 3rd rows

19.Print the matching word “pvpl” and append to file?

You might also like