-1

I've been checking out source codes of some Linux software. For instance, if I were to run cd /usr/bin and type sudo nano libreoffice, I would see the LibreOffice source code.

However most programs are different. For instance sudo nano cmatrix shows a lot of junk with few recognizable strings of text. It does state at the bottom of nano "Converted from Mac format". I'm not sure what that means, and I don't see it every time I see junk like this.

How can I see the source code of a program like this, or can't I?

Note I'm looking in /usr/bin based on this diagram. Also, note that this isn't restricted to nano. I've also tried vi, but I prefer nano.

NerdOfCode
  • 2,408
  • 4
  • 16
  • 33
wolf_math
  • 129
  • 3
  • also /usr/bin/libreoffice is not the source code for libre office. – ravery Mar 22 '18 at 02:32
  • 3
    Possible duplicate of [How do I get and modify the source code of packages installed through apt-get?](https://askubuntu.com/questions/28372/how-do-i-get-and-modify-the-source-code-of-packages-installed-through-apt-get) – muru Mar 22 '18 at 02:36
  • It is most likely compiled...However, you can find the source code for LibreOffice... there --> https://github.com/LibreOffice – NerdOfCode Mar 22 '18 at 02:56
  • If you do `file cmatrix` you'll probably see that this file is a binary (ELF). – muclux Mar 22 '18 at 06:42
  • @dsstorefile perhaps this only works for programs installed by `apt-get`? I only get `E: Unable to find a source package for ___` . I've installed all of my programs with `apt` – wolf_math Mar 23 '18 at 01:48

1 Answers1

3

That is not the "source code" for libreoffice, it's just a shell script that sets up the environment and starts the real libreoffice.

If you install the apt-src package, you can use it to download the actual source of ubuntu packages. Read man apt-src.

waltinator
  • 35,099
  • 19
  • 57
  • 93