Skip to content

Sorting files based on time in Linux

I want to get a list of pathnames of files, divided by one blank space, and the files are sorted based on creation time. I use to sort them, but the problem is, how can to delete all the time before the pathnames? If I use I can get a list of pathnames, but I don’t know how to sort

How to kill a process by its pid in linux

I’m new in linux and I’m building a program that receives the name of a process, gets its PID (i have no problem with that part) and then pass the PID to the kill command but its not working. It goes something like this: Can someone tell me why it isn’t killing it ? I know that there are som…

Linux total disk I/O from already running process

I’m working on a performance tool and I’m interested in the total disk I/O i single process have done since it started. I have the porcess PID and i can easily get the current I/O rate with tools like iotop or sar, but not the total I/O. Is this even logged in Linux and is there a way to get

Reasoning behind ‘sort’ core util’s key (-k) syntax

When using the sort function in a shell, it seems the preferred syntax for the -k option when sorting via only one field is, for example, -k5n,5. What’s the advantage of the ,5 in this case? -k5n works the same, or at least seems to for me. Refs: The man page seems to prefer this but also suggests it is