Sunteți pe pagina 1din 3

UNIX FAQ’S by PenchalaRaju Yanamala

1. What is the use of ls -l command & what is the information it gives about user?

A: - $ ls -l given the sorted file in long listing format. it gives the information such
as type(file/directory), permissions. Given to file, links, owner, group
user detail, date & time of modification etc.

2. What is an Environment Variable?

A: - Environment variables are a set of dynamic named values that can affect the
way running processes will behave on a computer.

3. Write a grep command that selects the lines from a file that have exactly three
characters?

A: - $ grep ^...$ <filename>

4. The rm command removes links to file. What does this mean? How then is a
file deleted from the file system?

A: - rm never delete the link. Only file get removed from index. So it will not come
when you will use ls command

5. how to change a normal file into hidden file

A:- my filename .filename.

6. What is "type" command in UNIX? What is the functionality??

A: - type [-aftpP] name [name ...] with no options, indicate how each name would
be interpreted if used as a command name.

7. how to find largest file?

A:-In the Directry Give....ls -ls|sort -nr|head -1that gives the largest file statistics...

8. How do you find which version and name of UNIX you are using at the
command prompt?

A:-Your name -a in HP-UX -s Operating system name -r release of the


version name

9. What is the command to change a file's creation time? Means one file is
created at the time 15:19 then time should br changed to 14:14

A:-use touch command to change the date

10. What will be the output of ls ~/...

A:-it will list the contents of home directory

11. Give the command to display space usage on the UNIX file system.

A:- df -k .

12. What is use of sed command?


A:- sed is a stream editor for editing files from a script or from the command line

12.how to remotely move a file ??? that mean how to move a file one machine to
another machine ???

A:- By ftp

13. What is file system in unix??

A:- ufs file system

14. How to setup Disk space as well as memory in solaris10?

A:- 1-BY using format command we can find the status of hard disk format

2-For knowing the memory status #prtconf grep Mem

15. Why we are using UNIX OS when we are doing the testing in our application?

A:- Security, Multitasking and backup etc..

16. What is FIND, GREP and SED ? Could you please give me the difference
between all the three? Where we use this commnands?

A:- FIND & GREP

Basically FIND & GREP are the UNIX commands shared through the
FILTERS .Where is SED (STREAM) is one of the main editor.

FIND : Find is an exclusive command used to find files/folders are other


information.and this is powerfull then windows.

ex : # find /raja -name shekar -print

output : raja/shekar

Grep : This is also one of the important command used toglobally searching the
regular expression in the file .GERP is grepping the information character by
character.(i.e) from file .ex 1) : #GREP "cat" raja

2) : #GREP -i "cat" raja (for case sensitive)

2) : #GREP -v "cat" raja (v represent negative )

OUTPUT :if we have an file raja with data regarding cat we can clearly
explain.Finally SED (STREAM)

17. what is the use of the hidden files?

A:- the use of hidden file is my file is not view any another to use only to show
myself

18. How many types of file in UNIX?

A:- total 7 files are there.

1. Regular file:(-):contains data in either text format orbinary format


2. Directory file:(d):contains entries of files

3. FIFO file:(f):2 communicate betn 2 processes running onsame system

4. Block special file:(b):name given 2 special blocks ofhard disk

5. Sybolic file:(l):its a link or pointer to alreadyexisting file

6. Socket file:(s):2 communicate betn 2 processes running on different system in


a network

7. Character special file:(c):handles only characted formatted data eg.stdin,


stdout, stderr

19. How will u execute a file in unix? IMP

A:- Depending on the type of shell you can execute a file in either of the ways

1) ksh <filename>

2) sh <filename>

If the file already possess execute bit set on it, then you can directly execute the
file with its name alone

1) <filename>

Or if the file doesn't have executable permissions than assign the same as
chmod 755 <filename>. after that execute the same by using command
./<filename>.

20. How do you create a file in UNIX?

$ cat >fruits.txt

Apple,orange, grapes

^d (Press control+d)

$ cat fruits.txt

Apple,orange,grapes. or

using touch & cat command.

21. Write a command to find all of the files which have been accessed within the
last 30 days.

A:- find / -type f -atime -30 > November.files & This command will find all the files
under root, which is "/", with file type is file. "-atime -30" will give all the files
accessed less than 30 days ago. And the output will put into a file call
November.files.

22. which command is used to stop a running process in unix?

A:- kill -9 pid its forcefully stop kill the curent process

S-ar putea să vă placă și