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

Which command is used to copy files?

0 Answers  


How do you know about running processes of a particular user?

11 Answers  


what is the difference between npar and vpar in HP-UX?

1 Answers   CSC,


how unix kernel distinguishes between a normal file and device file ?

7 Answers   Google, IBM, McAfee, Vodafone,


How to view the hidden files in /etc directory?

10 Answers  


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

0 Answers  


What do chgrp command do?

0 Answers  


What is the difference between cat and more command?

0 Answers  


Give the command for finding the current date.

0 Answers  


Who command in unix?

0 Answers  


distinguish between interrupts and exceptions?

2 Answers   Infosys, Wipro,


why unix operating system provides more security than other operating systems?

4 Answers  


Categories