
This means that our process is downloading files from the Internet. From the output, we can see all the connections are ESTABLISHED and that the program is identified as wget. Here, we used grep to filter connections associated with PID 46022.
p – display the process ID associated with each connection. a – display information about all connections (both listening and non-listening). In this example, we’ve used several options: Tcp 4452 1237 localhost.localdo:46940 nbg1-speed.hetzne:https ESTABLISHED 46022/wget Tcp 4452 1448 localhost.localdo:46940 nbg1-speed.hetzne:https ESTABLISHED 46022/wget Tcp 3345 7242 localhost.localdo:46940 nbg1-speed.hetzne:https ESTABLISHED 46022/wget Tcp 3345 1448 localhost.localdo:46940 nbg1-speed.hetzne:https ESTABLISHED 46022/wget Then, we can check the connection of our process: $ netstat -taucp | grep 46022 Let’s install the package first: $ yum install -y net-tools Netstat is part of the net-tools package. We can also use netstat to display network connections of a specific process. Netstat is a tool that displays network-related information, such as network connections and routing tables. The output displays a list of system calls made by the process, such as restart_syscall, ioctl, getpgrp, write, and clock_nanosleep. Moreover, we used -e to determine the type of system calls. In this case, we used the -p option to specify the PID of the process to trace. Now, we can start our tracing: $ strace -p 46022 -e trace=networkĬlock_nanosleep(CLOCK_REALTIME, 0,, NULL) = 0 We can use strace to capture network-related system calls made by a single process.įirst, let’s install strace via yum: $ yum install -y strace
Strace is a command-line tool that we can use to trace system calls and signals of a process.