Ps how long process running




















Mods - techraf, Makyen, David Rawson, Tsyvarev, Paul Roub - why don't you move it to a more appropriate site such as StackExchange or Superuser instead of closing the question? This is a good and useful question — Hanxue.

Show 7 more comments. Active Oldest Votes. Improve this answer. Gobliins - etime is the time elapsed since the process was started. Be aware that lstart time can change, the stat methods below are safer - unix.

Show 4 more comments. Community Bot 1 1 1 silver badge. Nathan Nathan 4 4 silver badges 2 2 bronze badges. To see every process not just your own add an e standard ps syntax or ax BSD syntax argument to the ps command: i. Add a comment. Slightly refactored for production use: gist. Bear in mind that the strftime and systime aren't present in mawk , which is the default awk in my Debian 8 VPS images, so I can only assume that they're specific to gawk 's dialect.

Adam Matan Adam Matan k gold badges silver badges bronze badges. This does not work for me - it prints modification time changes frequently Maybe because of this: unix. This returned a time 9 minutes later than when a process I have information about had actually started. This seems to be my only option that works, though maybe not reliable.

I'm on an embedded system that only has busybox ps which says invalid option for all the options mentioned by other answers.

Have you ever wondered how you can check all the programs running on your machine? Then this article is for you, as I'll show you how to list, manage, and kill all the running processes on your Linux machine. A process is an instance of a running computer program that you can find in a software application or command.

For example, if you open your Visual Studio Code editor, that creates a process which will only stop or die once you terminate or close the Visual Studio Code application.

Likewise, when you run a command in the terminal like curl ifconfig. You can list running processes using the ps command ps means process status. The ps command displays your currently running processes in real-time.

You can choose to display a certain set of processes by using any combination of options like -A -a , -C , -c , -d , -E , -e , -u , -X , -x , and others. If you specify more than one of these options, then all processes which are matched by at least one of the given options will be displayed.

To display all running processes for all users on your machine, including their usernames, and to show processes not attached to your terminal, you can use the command below:. You can also use the top task manager command in Linux to see a real-time sorted list of top processes that use the most memory or CPU. Type top in your terminal and you'll get a result like the one you see in the screenshot below:.

An alternative to top is htop which provides an interactive system-monitor to view and manage processes. It also displays a real-time sorted list of processes based on their CPU usage, and you can easily search, filter, and kill running processes.

Just type htop in your terminal and you'll get a result like the one you see in the screenshot below:. Killing a process means that you terminate a running application or command. To do so, you need to find the PID of a process , we can easily identify it by using pidof command. As per the above output, the process has been running in our server for 13 days, 13 hours, 13 mins, and 26 sec. If you would like to know how many hours the process has been running then use, Linux command line calculator.

If you would like to know for how many days the process has been running then use the following format. As per the below output the httpd process has been running since Aug As per the below output the httpd process has been running since Aug 05 at The proc filesystem procfs is a special filesystem in Unix-like operating systems that presents information about processes and other system information.



0コメント

  • 1000 / 1000