Determine the Starting Time of a Process on Linux

Windows Articles

How to get the Android 11 Notification Panel

It's no secret that even though Android is the most widely used mobile operating system. Not always our device has the latest...

How to create backups in Windows 10 with FileFort Backup

There is no doubt that the computer is an essential element in our lives. Indeed, its uses go beyond work or study....

Trisquel 9.0 available

Trisquel is a GNU/Linux distribution endorsed and supported by the Free Software Foundation. This means that in addition to incorporating the Linux...

How to install PandoraFMS on CentOS 8?

Worldwide many IT infrastructures are running Linux on one of their servers. This opens the door to an endless number of different...

How to force close a program using PowerShell

Hi! We have mentioned in the past that Windows allows you to open multiple programs at once. In fact, that is one...

In the Linux system, a number of processes must stay running all the time that ensures the system is up and working perfectly. We all know that Linux offers the most control over your system. Why not find out how long a process is running?

Well, no surprise. Linux allows doing that without the necessity of any additional package. In fact, the following tutorial is usable by almost any Linux user (unless your system is missing the core components).

Let’s find out.

Determining running time

In the regard, the “ps” command is the first choice. Most of the Linux CLI users are familiar with the standard UNIX or BSD notation when it comes to specifying the “ps” options.

If you want to get the UNIX notation, run the following command –

ps -ef

 

In the command output, the “STIME” column indicates the starting time of the process. From the above output, it’s clear that “bash” started at 23:02 (24-hr format). However, it doesn’t indicate the date.

According to the man page of “ps”,

Note – For usage convenience, the man page was extracted to a text file. Learn how to export Linux command outputs to a file.

Need to get the result with the BSD notation? Then use the following command –

ps aux

In the output, the “Start” column reveals the start date only if the process is older than the current date.

It’s also possible to tell “ps” to show the elapsed time in the output.

ps -eo pid,cmd,etime

This command specifies 3 different fields – the PID of the process, the command for running the process and the elapsed time respectively.

For the BSD notation, use the following command –

ps axo pid,cmd,etime

Enjoy!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to get the Android 11 Notification Panel

It's no secret that even though Android is the most widely used mobile operating system. Not always our device has the latest...

How to create backups in Windows 10 with FileFort Backup

There is no doubt that the computer is an essential element in our lives. Indeed, its uses go beyond work or study....

Trisquel 9.0 available

Trisquel is a GNU/Linux distribution endorsed and supported by the Free Software Foundation. This means that in addition to incorporating the Linux...

How to install PandoraFMS on CentOS 8?

Worldwide many IT infrastructures are running Linux on one of their servers. This opens the door to an endless number of different...

How to force close a program using PowerShell

Hi! We have mentioned in the past that Windows allows you to open multiple programs at once. In fact, that is one...
x