Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

 

Re: in a growing log file how will you see the 1st 99 lines?
Ans):-head -99 <file name> - display 1 st 99 lines
tail -99 <file name> - display last 99 lines

Re: 29. How to display top 10 users Who | head -10 | wc –w


Ans):- use below command
Who | head -10

Re: write grep commands to select the lines that have exactly two characters
Ans):- grep "^..$" filename

  Re: what is the difference between SED and GREP ? Which one is more better and why?
Ans):- Both serves the purpose of "pattern matching" in files.SED has
more features compared to simple GREP. Ex: like replacement of
existing string with new string. Deleting the lines in a file etc

  Re: what is the difference between KILL and KILL -9?


Ans):- Kill allows the child processes to be killed before parent process
is killed. Kill -9 forcefully kills the process without giving time to
child processes to be killed. In IPC architecture, it’s not good idea
to kill forcefully using "-9" option.

  Re: How to display a file name which has zero bytes in size.
Ans)- we can find using find command.
find / -size 0
This will print all files under / which has 0 size.

  Re: what is ls -ltd?


Ans):-ls - ltd
current directory information.
Option l: Long listing
t: Time Stamp
d: Information about current directory
(Useed with -l Option)

Re: Assume the following files are in the working directory prompt> ls -l tasks -rw-r--r-- 1 alex student
1423 Feb 21 14:01 tasks What command can Alex use to give everyone permission to write to the file?
What will the ls -l command display if he does so? Answer
#2

chmod 666 tasks will give all users (owner, group and
others) the read-write permission.
r = 4
w = 2
x = 1
therefore rw = 4+2 =6
ls -l : lists a large amount of information of all non-
hidden files and directories in the current working
directory. eg (permissions, owners, size, and when last
modified.

You might also like