if you want to know the process PID, you can use ps :
[user@desktop ~]$ ps h -o pid -C app1
the -o pid parameter says that you only want the PID of the process, -C app1 indicates the name of the process you want to request, and the h parameter is used to suppress the header of the result table (without it, you will see the "PID" header above the PID itself). not so, if there is more than one process with the same name, all PIDs will be shown.
if you want to kill this process, you can use:
[user@desktop ~]$ kill `ps h -o pid -C app1`
although killall cleaner if you just want to do it (and if you don't mind killing all the processes of "app1"). you can also use head or tail if you want only the first or last PID, respectively.
and a hint for fish users: %process is replaced by the PID process . so in fish you can use:
user@desktop ~> kill %app1
cd1
source share