Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.04.4 LTS 64 bit

My LibreOffice suite (especially Writer) used to freeze!

I tried to search for the executable process at System Monitor and command line (ps) but didn't find it

How can I kill LibreOffice and Can I kill only the writer? (not the Calc,Impress,..)

EDIT: I want something like this:

pkill -9 *writer*

I need Some kind of minified command

share|improve this question
1  
one of my best tricky questions. –  nux Mar 12 at 12:29
add comment

2 Answers 2

up vote 3 down vote accepted

First search for open libreoffice files:

ps aux | grep libre

For example the output of mine is:

hadi  21426  0.1  0.0 205328  3468 ?        Sl   14:17   0:00 /usr/lib/libreoffice/program/oosplash --writer
hadi  21445  9.8  0.7 1269272 179872 ?      Sl   14:17   0:01 /usr/lib/libreoffice/program/soffice.bin --writer --splash-pipe=6

then

sudo kill -9 ID

the ID is the second number for (soffice.bin) not for oosplash

so in my example:

sudo kill -9 21445

You need professional Ok:

ps aux | grep -i office | awk {'print $2'} | xargs kill -9

hope this is professional in your evaluation!!

or more minified command

kill -9 `pgrep -lf soffice.bin | awk {'print $1'}`

or more minified minified minified command

pkill soffice.bin

EDIT:

All libreoffice open files take the same PID, for that you can't just kill writer and keep impess for example.

And to prove my point of view the recovery tool in office is unique for all files. What i mean if you close a writer in imporper way and then open an impress for example then impress will request you to recovery the writer file and it did so and this proves my answer

share|improve this answer
    
I know, this is not the professional way. I need 1 command –  kamil Mar 12 at 12:18
    
no when killing soffice it will kill all libreoffice programs when opened , try to open impress and writer and kill this process it will kill them both, it is a parent process –  nux Mar 12 at 12:22
    
op needs just to kill writer , maybe he use to open calc and impress with writer :) –  nux Mar 12 at 12:25
    
@nux YES that's someone who understands my need –  kamil Mar 12 at 12:26
    
You can't do it. All libreoffice open files take the same PID. –  Ask Mar 12 at 12:29
show 6 more comments

use ps -e to list all processes running (not just those spawned by your current terminal). You can then search for the name you are looking for (Perhaps 'writer' or 'Libre'). If you know exactly the name you're looking for you could use ps -e | grep writer to give you the results for that process only.

You should see a number which is the process id (PID). To kill the process, enter kill x where x is the PID of the process. You should get a message saying something along the lines of killed 1 process. If the process is still running, try kill -KILL x to force the program to quit.

share|improve this answer
    
it doesn't work my dear –  kamil Mar 12 at 12:27
    
Which bit didn't work? –  Hugo Buff Mar 12 at 12:28
    
ps -e | grep writer doesn't return anything –  kamil Mar 12 at 12:31
1  
You'll have to just use ps -e and search through the names for the right process. writer was just a guess. –  Hugo Buff Mar 12 at 12:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.