0

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.

sagar
  • 101
  • 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. Jul 11 '21 at 21:53

1 Answers1

0

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.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287