How can I close all opened Nautilus (explorer) windows from the terminal?
Asked
Active
Viewed 2.5k times
2 Answers
22
nautilus -q
or
killall nautilus
If nautilus
is in the middle of doing something you should use the first command as it allows nautilus
to exit gracefully. The second command just "terminates" nautilus
so if invoked in the middle of e.g. a copy/move operation you might end up with corrupted data.

don_crissti
- 82,805
5
pkill nautilus
Or to kill everything with nautilus in the name, while insisting:
pkill -9 -f nautilus

Alexander
- 9,850
-
-
2The side-effects of kill -9 are no big deal. I agree that the executable should have had a chance to shut down cleanly first, but "do not kill -9" gives associations to parents that want their child to wear a helmet at all times. – Alexander Jun 09 '13 at 15:40
-
1Yeah, not using kill -9 is impractical. In a perfect world, we don't even need to use pkill at all. – Sridhar Sarnobat Nov 19 '20 at 03:41
killall nautilus
didn't work for me (over ssh). – Sridhar Sarnobat Nov 19 '20 at 03:40nautilus --quit
– user598527 May 26 '23 at 07:42