GNU binary utility - Strip [SOLVED]

Moderator: Forum moderators

Post Reply
User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 357 times

GNU binary utility - Strip [SOLVED]

Post by Jasper »

Hi there

Can someone tell me who I can use this command to apply to a directory?

Presently, I am having to do this files individually.

Thanks in advance :thumbup:

Last edited by Jasper on Fri Dec 23, 2022 6:43 pm, edited 1 time in total.
mistfire
Posts: 650
Joined: Thu Jul 16, 2020 2:16 am
Location: CALABARZON, PH
Has thanked: 3 times
Been thanked: 143 times

Re: GNU binary utility - Strip

Post by mistfire »

Jasper wrote: Thu Dec 22, 2022 2:34 pm

Hi there

Can someone tell me who I can use this command to apply to a directory?

Presently, I am having to do this files individually.

Thanks in advance :thumbup:

Strip command removes some symbols on ELF binaries. This will reduce the file size
It only works on ELF executables and library files

To strip files

Code: Select all

find <folder> -type f | xargs -i strip --strip-unneeded '{}'

To strip library files

Code: Select all

find <folder> -type f -name "*.so*" | xargs -i strip --strip-unneeded '{}'

To strip kernel modules

Code: Select all

find <folder> -type f -name "*.ko" | xargs -i strip --strip-unneeded '{}'
User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 357 times

Re: GNU binary utility - Strip

Post by Jasper »

@mistfire

Thank you so much for sharing the knowledge.

I will be honest, I did a system-wide strip of the relevant directories. Of course, their were some files that were not recognised but in the whole it worked.

I did have to load up the DevX file in order to do so.

Also, I could not shut down normally and had to resort to a physical power down. This wasn't a big deal as I knew I would be given the option to "save" which I did.

Rebooted and everything appears to be working so far. The only issue is that I have a menu entry "Glade" left over. I can live with that :lol:

**EDIT** Fix Menus cleaned up the menu entries :thumbup2:

Post Reply

Return to “Compiling”