1-how will you display a file whose name is starting with '-
'?
2-how will you add a patten at end of every line in vi
editor?

Answers were Sorted based on User's Feedback



1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / habs

Q1: ls | grep "^\-"

Is This Answer Correct ?    6 Yes 1 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / dibya lochan giri

ans of Q2-using cmd :1,$ s/$/pattern name/
or %s/$/pattern name/g

Is This Answer Correct ?    6 Yes 3 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / anonymous

Q1 - ls -- -*

Is This Answer Correct ?    0 Yes 0 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / vamshi

1,$ s/^/-/g

2. 1,$ s/$/P/g

Is This Answer Correct ?    0 Yes 1 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / sri

1. ls -.*

Is This Answer Correct ?    0 Yes 1 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / shaishaw

how will you display a file whose name is starting with '- '
$ find / -type f -name "-*" -print 2>null

/home/staff/thaler/-
/home/staff/thaler/-FF
/home/patron/polly/-n
/home/member/plucky/-w
/home/nijwala/bsn/-a.out
/home/mvpbhat/-foo
/home/mvpbhat/-l

Is This Answer Correct ?    0 Yes 1 No

1-how will you display a file whose name is starting with '- '? 2-how will you add a pat..

Answer / shh

1) ls _*

2) 1,$ s/$/<addtext>/g

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Unix Commands Interview Questions

What are the general commands in using unix os for a beginner?

0 Answers  


What is $0 bash?

0 Answers  


What is the use of the command 'ls -x chapter[1-5]' ?

0 Answers  


How does a user get the current date, time in UNIX?

6 Answers   IBM,


write grep commands to select the lines that have exactly two characters

8 Answers   PSI Data Systems,






what is the difference between KILL and KILL -9?

5 Answers   Informatica, Nutanix,


What is the nmap command?

0 Answers  


Give Command that will move a single file called "unix.txt"

7 Answers   IBM,


what do you understand by 'unix is a portable os'?

3 Answers   Infosys,


distinguish between paging and swapping?

1 Answers   Infosys,


What do know about tee command and its usage?

0 Answers  


How do you copy a directory with many files and folders into another directory?

2 Answers  


Categories