Interview questions on UNIX with answers

(1) when we copy one directory to another directory,does the hidden files also get copied ?
Ans. No

2)How to list the attributes of the current directory ?
Ans ls -ld .

3.) How hidden files are removed ?
Ans rm .[!.]*

4.)Can the filename contain / character?
Ans No

5)What is the limit on the length of the filename in unix ?
Ans 255 characters

6)cat file1 > /dev/null What is the size of /dev/null file after above command is executed successfully ?
Ans 0 bytes

7)How to acces the positional parameters having position greater than 9 ?
Ans using shift operator

8)ln file1 file2 will the exit status of the command cp file1 file2 be zero ?
Ans No

9)wc < chap[1-5] ?
Ans ) above command will be executed successfully if only one file matches the pattern else it will
give error

10)the commands for which the executable is not executed are called……..

Ans Internal commands like echo,more

11) if u want to change in sccs ,which command do u use ?
Ans delta

12)what is the default permission for file and directory ?

Ans 666 and 777

13) write 3 commands for quit with saving the information in vi editor ?
Ans :wq,:x (Esc mode) ZZ(command mode)

14.) abbr command is used for ?
Ans ) for creating macros in vi

15) If only wx permission is given to the directory then…………
Ans) everything is possible except the listing of files.

16) what is the o/p of $ >xxx ?
ANS. creates a 0 byte file called xxx

17) what is the result of $ ln file1 file2 ; cp file1 file2 dir1
ANS. It will create these 2 new files file1,file2 in the directory dir1 & not new links

18)what is the o/p for $ mv file1* ..
ANS. all files having names starting with file1 are moved to parent directory.

If you have questions, please ask below

Leave a Reply

If you have any questions headover to our forums

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>