• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

strip Command Examples in Linux

by Deepika

The strip command is a Linux utility that is used to remove debugging and symbol information from executable files and object files. This results in a smaller file size, as well as an increased level of security since sensitive information, such as function and variable names, are removed.

The strip command works by removing symbols and other information from the binary file. This can be done either during the build process, by passing the -s flag to the linker, or after the file has been built, by running the strip command on the executable or object file.

Some common use cases of strip include:

Reducing file size: By removing symbol and debugging information, the size of an executable or object file can be reduced significantly. This is particularly useful when distributing applications, as smaller file sizes result in faster download times and reduced storage requirements.

Protecting sensitive information: By removing symbols and debugging information, strip can help prevent reverse engineering and other forms of code analysis that could reveal sensitive information, such as function and variable names. This can be particularly important in security-sensitive applications.

Improving performance: Stripped executables and object files load faster than unstripped ones since there is less information that needs to be loaded into memory.

strip Command Examples

1. Replace the input file with its stripped version:

# strip path/to/file

2. Strip symbols from a file, saving the output to a specific file:

# strip path/to/input_file -o path/to/output_file

3. Strip debug symbols only:

# strip --strip-debug path/to/file.o

Summary

It is important to note that strip permanently removes symbol and debugging information from a file. This means that if debugging information is required later, the file will need to be recompiled with the necessary options.

Overall, strip is a useful tool for reducing file size, improving performance, and protecting sensitive information in Linux executables and object files.

Filed Under: Linux

Some more articles you might also be interested in …

  1. git fsck: Verify the validity and connectivity of nodes in a Git repository index
  2. mdadm Command Examples in Linux
  3. Mac Terminal vi[m] Editor Commands
  4. fakeroot: command not found
  5. ptx: command not found
  6. aws history: Print the command-line history for AWS CLI commands (Command Examples)
  7. “docker machine” Command Examples
  8. jest Command Examples
  9. v4l2-ctl Command Examples in Linux
  10. “hg remove” Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright