Is it safe to remove these files with "microsoft" in the name?

Solution 1:

These files have nothing to do with Windows, and are not from Microsoft. Deleting them will simply break some of the packages you have installed (and any features which rely on those files being there), and those files will simply be replaced when those packages get updated later anyway. There's no point in removing them.

Solution 2:

These files fall into four groups:

/lib/modules/4.13.0-16-generic/kernel/drivers/hid/hid-microsoft.ko
/usr/src/linux-headers-4.13.0-16-generic/include/config/hid/microsoft.h  

These are drivers and support files for Microsoft-branded input devices (keyboards and mice). They are vaguely Microsoft-related, but probably contain no Microsoft code. You can probably remove them safely, though if you've got Microsoft hardware, you might lose things like support for media keys or extra mouse buttons. I don't think any Microsoft hardware is completely incompatible with the generic USB or PS/2 drivers.

/usr/lib/os-probes/mounted/20microsoft
/usr/lib/os-probes/mounted/efi/20microsoft

These are part of the Grub bootloader, used to detect if there is a Microsoft operating system present or not on a separate partition/volume. I'm not familiar enough with the internals of Grub to say if deleting them would be harmless, or if it would break your system entirely.

/usr/share/X11/locale/microsoft-cp1251
/usr/share/X11/locale/microsoft-cp1255
/usr/share/X11/locale/microsoft-cp1256
/usr/share/X11/locale/microsoft-cp1251/Compose
/usr/share/X11/locale/microsoft-cp1251/XI18N_OBJS
/usr/share/X11/locale/microsoft-cp1251/XLC_LOCALE
/usr/share/X11/locale/microsoft-cp1255/Compose
/usr/share/X11/locale/microsoft-cp1255/XI18N_OBJS
/usr/share/X11/locale/microsoft-cp1255/XLC_LOCALE
/usr/share/X11/locale/microsoft-cp1256/Compose
/usr/share/X11/locale/microsoft-cp1256/XI18N_OBJS
/usr/share/X11/locale/microsoft-cp1256/XLC_LOCALE
/usr/share/X11/xkb/geometry/microsoft
/usr/share/doc/libx11-dev/i18n/compose/microsoft-cp1251.html
/usr/share/doc/libx11-dev/i18n/compose/microsoft-cp1255.html
/usr/share/doc/libx11-dev/i18n/compose/microsoft-cp1256.html
/usr/share/fonts/X11/encodings/microsoft-cp1250.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1251.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1252.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1253.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1254.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1255.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1256.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1257.enc.gz
/usr/share/fonts/X11/encodings/microsoft-cp1258.enc.gz
/usr/share/fonts/X11/encodings/microsoft-win3.1.enc.gz

These are files describing the Windows cp125* family of character encodings. You don't want to remove them: things will break badly if you ever visit a website using one of these encodings (about 5% of the web) or try to open a text document using one of them. They're Microsoft-related only in the sense that they describe Microsoft practices.

/usr/share/mime/image/vnd.microsoft.icon.xml

This simply describes the MIME type for the Windows Icon file format. Removing it means that .ico files will be described as "Data file" rather than "Windows Icon", but shouldn't have any other effects.

Solution 3:

You could find out which package these files are part of, then decide that removing that package is wrong, by:

locate *microsoft* | xargs -n 1 dpkg -S

Of course, read man xargs and man dpkg.