17

How can I close all opened Nautilus (explorer) windows from the terminal?

2 Answers2

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