I am new to linux.I want to that how to find out through terminal that if any system command uses specific system call internally? Suppose hard linking is to be performed . So "ln" command uses li nk() system call internally. Likewise rm command uses unlink() system call.
-
The question is not clear and needs more details. Do you wan to find out if a specific program/command uses a certain system call? Or do you want to monitor a running system to find out which program(s) use a specific system call?C. M.– C. M.2021-07-11 21:53:36 +00:00Commented Jul 11, 2021 at 21:53
Add a comment
|
1 Answer
You can follow the system calls used by a program with strace. For example
strace -f ls
There are many options, see man strace on your system or online for details, including the ability to filter its output to show only selected system calls, input/output, etc.
Note that if you strace a setuid/setgid program, for example /usr/bin/passwd (setuid root), the target application's privileges will be discarded during the trace.