08-26-2008
This really smells like homework to me. If it is an interview question and you do not know the answer, you would be more than foolish to attend the interview. Even if you make it past the interview you would be let go for falsifying your credentials later on.
Either way - I don't know.
Answer depends on the OS - possibly one of these: truss, tusc, strace, maybe ptrace.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the Text file ex sample.txt
cat sample.txt
morning
evening
night
bye
__________________
i want add text "Good " i front of all the words .
u have to use one vi command only
or
u can write script also
o/p should be like this
cat sample.txt
Good morning
Good evening (7 Replies)
Discussion started by: premnathk
7 Replies
2. Shell Programming and Scripting
hi i have cancelled my previous post (2 Replies)
Discussion started by: choco4202002
2 Replies
3. UNIX for Dummies Questions & Answers
what distros have you selected in the past, for which applications, and
why did you choose them? Would you make the same choices again,
knowing what you know now?
Any help will be really appreciated!! (2 Replies)
Discussion started by: choco4202002
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I went for an interview this morning. The questions I was asked....
1. On Redhat, you have downloaded a program called XYZ. You did all kinds update to this program. Now you are ready to move this to production. How would you do it?
He already said he doesn't want to use "tar &... (2 Replies)
Discussion started by: samnyc
2 Replies
5. UNIX for Dummies Questions & Answers
Hi guys, i'm undergoing a traning in solaris administration and i request if any one have an idea on the interview questions on solaris.
thank you. (3 Replies)
Discussion started by: 038karthik
3 Replies
6. Shell Programming and Scripting
1. Create a directory script (project_dir.sh)
· Write a script in your home directory to create a subdirectory called “PROJECT<99>” within your home directory on the Ubantu/Linux server. <99> is your project number (e.g. 01,02,03, ... 15).
· The script must test whether... (1 Reply)
Discussion started by: bugenhagen_
1 Replies
7. UNIX for Dummies Questions & Answers
A process(apache/webservice) is continually writing a log(it is a single log, there are no several logs with different file names) onto a unix system.
the file system is filling up. How do you handle the situation.
Is there a way to handle this situation without killing the parent process.(... (1 Reply)
Discussion started by: ramky79
1 Replies
8. Red Hat
pls any one tell all the interview question about linux administrator for L1 and L2... (3 Replies)
Discussion started by: deepansekaran
3 Replies
LEARN ABOUT FREEBSD
truss
TRUSS(1) BSD General Commands Manual TRUSS(1)
NAME
truss -- trace system calls
SYNOPSIS
truss [-facedDS] [-o file] [-s strsize] -p pid
truss [-facedDS] [-o file] [-s strsize] command [args]
DESCRIPTION
The truss utility traces the system calls called by the specified process or program. Output is to the specified output file, or standard
error by default. It does this by stopping and restarting the process being monitored via ptrace(2).
The options are as follows:
-f Trace descendants of the original traced process created by fork(2), vfork(2), etc.
-a Show the argument strings that are passed in each execve(2) system call.
-c Do not display individual system calls. Instead, before exiting, print a summary containing for each system call: the total system
time used, the number of times the call was invoked, and the number of times the call returned with an error.
-e Show the environment strings that are passed in each execve(2) system call.
-d Include timestamps in the output showing the time elapsed since the trace was started.
-D Include timestamps in the output showing the time elapsed since the last recorded event.
-S Do not display information about signals received by the process. (Normally, truss displays signal as well as system call events.)
-o file
Print the output to the specified file instead of standard error.
-s strsize
Display strings using at most strsize characters. If the buffer is larger, ``...'' will be displayed at the end of the string. The
default strsize is 32.
-p pid Follow the process specified by pid instead of a new command.
command [args]
Execute command and trace the system calls of it. (The -p and command options are mutually exclusive.)
EXAMPLES
# Follow the system calls used in echoing "hello"
$ truss /bin/echo hello
# Do the same, but put the output into a file
$ truss -o /tmp/truss.out /bin/echo hello
# Follow an already-running process
$ truss -p 34
SEE ALSO
kdump(1), ktrace(1), ptrace(2)
HISTORY
The truss command was written by Sean Eric Fagan for FreeBSD. It was modeled after similar commands available for System V Release 4 and
SunOS.
BSD
May 12, 2009 BSD