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 is the difference between KILL and KILL -9?

5 Answers   Informatica, Nutanix,


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

6 Answers   IBM,


if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command use in unix? plz send this question.

28 Answers   TCS,


29. How to display top 10 users Who | head -10 | wc –w

4 Answers   TCS,


What is s and g in sed command?

0 Answers  






how will u execute a file in unix

8 Answers   QA,


in UNIX ,What is the command to view contents of a large error log file?

7 Answers  


What is grep command in unix with examples?

0 Answers  


How do you create a file in UNIX

36 Answers   Accenture, EMG, Nokia, QA, TD,


What are reported commands?

0 Answers  


what will be the output of ls ~/..

27 Answers   ABC,


How does shebang work?

0 Answers  


Categories