Vous êtes sur la page 1sur 5

25 UNIX

Intervie
w
Questio
ns

Jan 22

2015

This document contains 25 Unix interview


questions for BI and DW and analytics
professionals. These are very basic questions and
generally used to check basic understanding of an
individual on UNIX file handling and script
management.

http://etllabs.com

http://etllabs.c
om

Page 1

25 UNIX Interview Questions for BI


Professional
1. What Client tools (terminal emulator / Telnet client) do you use to work on UNIX?
2. What GUI tools (SFTP/FTP/SCP client) you have used to work in UNIX?
3. What if, your client only allows you to connect with UNIX box with secure
connection? Do you know any free GUI tool used in your project?
4. How to check the date of a file?
5. How to list the file so we can get last file at last?
6. How to check the latest file in set of files?
7. How to take the backup of the file so the original file data is safe?
8. How to remove junk characters from a file in UNIX. Example cntrl m?
9. What is folder structure of a project? Explain folder structure of your project?
10. One fine day you find out that your loads are failing because files are not
available. What will be your course of action?
11. How to find a file in same directory?
12. How to find a file in all the subdirectory?
13. How to do a global file search in UNIX, that means file search in all the places for
that UNIX instance?
14. If your load takes flat file before a particular timestamp. Then how you will
change it so it can be loaded.
15. How to identify a UNIX process running in background for any ETL process.
16. How to identify and kill a UNIX process running for an ETL process.
17. How to list hidden files in a directory?
18. Is there any way you can connect with SQLplus through UNIX command prompt?
19. In what kind of circumstances you need to require connecting to SQLPlus
through UNIX when it can be done with GUI like Toad, SQL Developer, and
SQLPlus?
20. How to verify if your UNIX script is able to connect with database?
21. How to capture records returned through database in UNIX script?
22. How to place records or error value in log which has returned through Database?
23. How to debug a UNIX script?
24. How to learn your new project UNIX script and folder structure if you are new to a
project?
25. What is the most common UNIX script structure do you know? Why do you need
to know UNIX script structure?

http://etllabs.com

Page 2

25 UNIX Interview Questions with


Answer
1. What Client tools (terminal emulator / Telnet client) do you use to work on UNIX?
Putty client, emacs editor, ssh secure shell client

2. What type of GUI tools (SFTP/FTP/SCP client) you have used to work in UNIX?
ssh secure shell client, WINscp, filezilla

3. What if, your client only allows you to connect with UNIX box with secure
connection? Do you know any good GUI tool which can do this for you?
ssh secure shell client, its not a free client.

4. How to check the date of a file?


ls l (long listing gives modified date)
5. How to list the file so we can get last file at last ( ascending order)?
Do you mean ascending order? Ls t | tac
For descending order ls -t

6. How to check the latest file in set of same file?


ls ltr filenamexxx*

7. How to take the backup of the file so the original file data is safe?
Copy the file to backup directory.

8. How to remove junk characters from a file in UNIX. Example cntrl m


http://etllabs.com/unix/remove-m-characters-ctrl-m-unix/1944/ - Please refer link.

9. What is folder structure of a typical DW, BI BIG DATA project? Explain the folder
structure of your project.
In general (folders names are always in bold)
Inbox->SourceName->Data files & Audit files, Archive, Trigger
Bin/projectName/Scripts, Config, Parameters
Bin/projectName/backup (code backup)
Outbox->Archive , files
ProjectName/LogFiles/Archive (for log files)

10. One fine day you find out that your loads are failing because files are not
available. What will be your course of action?
Hold ETL schedule.
Check with upstream systems if the files are not arrived.
Insert the failed ETL jobs and their dependent jobs into schedule once the files are
arrived.
Permanent solution: Add a trigger (file dependent) to your ETL jobs to avoid this
situation.

11. How to find a file in same directory?


ls <filename>

12. How to find a file in all the subdirectory?


ls if you are aware of the subdirectory structure.

http://etllabs.com

Page 3

Use find command if you are not aware of subdirectory structure,


find find /var/opt/project -name "filenametosearch"

13. How to do a global file search in UNIX? That means file search in all the places
for that UNIX instance?
Use UNIX find command. find / -name "filenametosearch"
14. If your load takes flat file before a particular timestamp. Then how you will
change file timestamp so it can be loaded.
touch -d "2015-06-23 12:12:12.000000000" "filenametochange"
15. How to identify a unix process running in background for any ETL process.
Use ps -e

16. How to identify and kill a Unix process running for an ETL process.
Use UNIX ps to identify
Use kill kill -9 <process_id> to kill any process.

17. How to list hidden files in a directory ?


You can use ls a. (Hidden files generally start with .)

18. Is there any way you can connect with SQLplus through UNIX command prompt?
Its sqlplus syntax
Sqlplus user/password@database

19. In what kind of circumstances you need to connect to SQLPlus through UNIX
when it can be done with GUI like Toad, SQL Developer, SQLPlus?
When you want execute sqlscripts through a job (Shell script).
When you want to dynamically create a sql statement and execute it as part of ETL
load.
When there is a need to perform reconciliation (status check) in the middle of ETL
jobs.

20. How to verify if your UNIX script is able to connect with database?
Capture it through $?., If the DB script is not executed properly it will return 0.
21. How to capture records returned through database in UNIX script?
If records then definitely to a file, it is also possible to user variables if you are returning
finite number of fields.

22. How to place records or error value in log which has returned through Database?
Capture it through $?., If the DB script is not executed properly it will return 0.
23. How to debug a UNIX script?
Divide the script and label them, evaluate the execution status at every label as a
check point.
Maintain a prototype / framework of the script for a project, and encourage
developers to add their logic to a particular section keeping rest of the processes like
error handling, error logging, variable assignment etc intact

24. How to learn your new project UNIX script and folder structure if you are new to a
project?
Its easy, if you have a script prototype. You can even ask for project script prototype
and should be part of development documentation.
If not, there is no other way but just walk through the script; Sometimes accurately
designed scripts produce great log files and you can understand the process just
looking at the log files.

http://etllabs.com

Page 4

25. What is the most common UNIX script structure do you know? Why do you need
to know UNIX script structure?
http://etllabs.com/unix/unix-shell-scripting-introduction/2760/ Please refer link

---------------------------------------------------------------------------------------------------------Legal: This PDF is published by etllabs.com as Creative Commons Zero licenses. That
means you are free to rename, modify, share and distribute these questions to anyone
without any fear.
Legal: - TERMS DISCLAIMER
----------------------------------------------------------------------------------------------------------

http://etllabs.com

Page 5