1

I am new to Linux. in the below commands, I can see rsync is listed in ls. but I am not able vi or cat to read it.

bash-3.1# ls /usr/local/bin
admenu
canreqs
cwtmp
pidof
procan
rsync
rsyncTransfers.sh
rsyncTransfers.sh_20171101
rsyncTransfersLog.txt
screen
socat
bash-3.1# vi /usr/local/bin/rsync
bash-3.1# cat /usr/local/bin/rsync

Vi and Cat showing file content as unreadable characters. I suppose it is binary executable. The file does not have extensions, is it possible to read the source code or at least tell which programming language it is written in?

3

It is a compiled binary, there is no way to read it when it is compiled.

From its wikipedia page we can see that rsync is written in the C languange:

Written in C

rsync as most GNU tools is open-source, thus, you can read its source too.
It has its own repository, which you can clone, as quoted in rsync's download page:

git clone git://git.samba.org/rsync.git

Once you clone it, you can browse, read, edit, and do whatever you want to all of its source files.

If you are new to git, you can also just browse its files in its gitweb.

  • Not so perfect :), what you get is the source of another version of rsync. If you want the source of the version of rsync on your system, you get it from your distribution repository, for instance, on Ubuntu: apt-get source rsync (after adding the source code repositories to your software sources). – xenoid Aug 28 '18 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.