Saturday, May 7, 2022

Interview Questions: - (UNIX - 2)

UNIX: -

 

Q) Different methods to create a file?

Ans – vi

cat

touch

 

Q) What command will connect and transfer files in single line command?

Ans – scp command

scp source destination

Example –

scp /land01/path02/inbound/file34.dat username/password@servername:path

 

Q) How you know a server www.abc.com is up and running fine?

Ans - $ ping www.abc.com

If you will get output continuously, then it’s up and working fine otherwise not.

 

Q) How to create a tar file?

Ans - $ tar –cvf file.tar f1.txt f45.csv f2.dat<Enter – Key>

Where c – create

V – verbose mode

f - forcefull

 

Q) How to extract files from tar file or unzipped the tar file?

Ans - $ tar –xvf file.tar<Enter – Key>

Where x – extracts

V – verbose mode

f – forcefully

 

Q) How to delete a file from tar file?

Ans -  $ tar - - delete –f file.tar f1.txt<Enter – Key>

 

Q) How to append a file into tar file?

Ans - $ tar –rf file.tar f3.dat<Enter – Key>

Where r – append

 

Q) What is the use of tar ball ?

Ans – It helps in moving the files from one environment i.e. development or testing to another i.e. testing or production.

 

Q) How to zip a file and unzip a file?

Ans - $ zip file.zip f1.txt<Enter – Key>

Or

$ zip file23.zip f67.txt f45.dat fnv.png<Enter – Key>

$ unzip file.zip<Enter – Key>

 

Q) How to zip a file in its original location?

Ans - gzip f1.txt f2.csv f3.dat<Enter – Key>

$ gunzip f1.txt.gz f2.csv.gz f3.dat.gz<Enter – Key>

No comments:

Post a Comment

Interview Questions: - (UNIX - 0) UNIX: -   Q) How to get inode number of a file/directory? Ans – $ ls –i <File/Directory_Name...