What does the output of file "/bin/cp" mean

6,669

Let's take it apart piece by piece:

  • /bin/cp name of the program you're passing to file command. In this case , it is cp, the program for coppying files and folders.
  • ELF 64-bit LSB shared object: an external program can use this program's functionality. See my related question Executables vs Shared objects
  • x86-64 - compiled for 64-bit OS
  • version 1 (SYSV) - uses Unix System V standard for ABI. See Linux file command: what does SYSV imply?
  • dynamically linked - uses functionality of other programs/libraries. See kos's answer on my question.(Link #1)
  • interpreter /lib64/ld-linux-x86-64.so.2 - this is the program that will load the executable and all the libraries necessary for the program to work. See PatchELF for simple explanation in the first pargraph. See also Dynamic Linker on Wikipedia
  • for GNU/Linux 2.6.32 - the glibc library used to compile that program was targeted at Linux kernel 2.6.32. See linux command “file” shows “for GNU/Linux 2.6.24”

  • BuildID[sha1]=ea4510e2ea94e09894383430c178b21df065faac - sha1 hashsum for the build session, most useful for developers to debug their program and see which particular version of their code was used. See What does BuildID SHA1 mean?

  • stripped - contains no debugging information. See What are stripped and not-stripped executables in Unix?

Share:
6,669

Related videos on Youtube

bel
Author by

bel

Updated on September 18, 2022

Comments

  • bel
    bel almost 2 years

    The output of file /bin/cp is :

    /bin/cp: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=ea4510e2ea94e09894383430c178b21df065faac, stripped
    

    what does it mean ?

    • user4556274
      user4556274 over 7 years
      Have you started by reading the manual page for file , to understand its basic function and output?
    • George Udosen
      George Udosen over 7 years
      That's the copy command used to copy files in Linux, and file /bin/cp is used to describe the file type. Run man file in terminal to see what file command does.