thelinuxstuff.blogspot.in 2011 12 interview linux question answers part 4.html

3
Interview Linux Question & Answers-PART 4 How to see the f ree memory in Linux? /proc/meminf o / f ree How you will see a port is opened or not? netstat –an |grep LISTEN (or) nmap ipaddress What is Sticky bit ? If the sticky bit is set f or a directory, only the owner of the directory or the owner of a f ile can delete or rename a f ile within that directory The sticky bit is an access-right f lag that can be assigned to f iles and directories on Unix systems. The most common use of the sticky bit today is on directories, where, when set, items inside the directory can be renamed or deleted only by the item's owner, the directory's owner, or the superuser (Without the sticky bit set, a user with write and execute permissions f or the directory can rename or delete any f ile inside, regardless of the f ile's owner.) What are the process states in Unix?

Upload: shitesh-sachan

Post on 08-Apr-2016

8 views

Category:

Documents


0 download

DESCRIPTION

Thelinuxstuff.blogspot.in 2011 12 Interview Linux Question Answers Part 4.HTML

TRANSCRIPT

Interview Linux Question & Answers-PART 4

How to see the f ree memory in Linux? /proc/meminf o / f ree

How you will see a port is opened or not? netstat –an |grep LISTEN (or) nmap ipaddress

What is Sticky bit ? If the sticky bit is set f or a directory, only the owner of the directory or theowner of a f ile can delete or rename a f ile within that directory The sticky bitis an access-right f lag that can be assigned to f iles and directories on Unix systems.The most common use of the sticky bit today is on directories, where, when set, items inside the directory can be renamed or deleted only by the item's owner, the directory's owner, or the superuser (Without the sticky bit set, a user with write and executepermissions f or the directory can rename or delete any f ile inside, regardless of the f ile's owner.)

What are the process states in Unix?

Followers

As a process executes it changes state according to its circumstances. Unix processeshave the f ollowing states:Running : The process is either running or it is ready to run .Waiting : The process is waiting f or an event or f or a resource.Stopped : The process has been stopped, usually by receiving a signal.Zombie : The process is dead but have not been removed f rom the process table.

How do you list currently running process? ps

How do you stop a process? kill pid

How do you f ind out about all running processes? ps -ag

How do you search f or a string inside a given f ile? grep string f ilename

How do you search f or a string inside a directory? grep string *

How do you search f or a string in a directory with the subdirectories recursed? grep -r string *

How do you check the sizes of all users home directories (one command)?a. du -sdfThe du command summarizes disk usage by directory. It recurses through allsubdirectories and shows disk usage by each subdirectory with a f inal total at the end.