I downloaded google-chrome for Linux, it got downloaded as a .deb file in downloads folder. I changed the current directory to the downloads folder and ran "google-chrome" in terminal. It started google chrome, but the issue is that .deb file is not a script(as I understand). Then how did the terminal understand that the 'google-chrome' command meant to start it? Commands like emacs...etc are already built-in. What about this command which is new to bash? How did it recognise it?
First a few basics:
When you run a command on your terminal, you enter the name of a file, (which should be executable): if you enter a simple name e.g.
Alternatively, you can enter a more complex filename, which include the directory :
Now back to your question:
When installing software, the system has to take care of putting everthing in the right place, so you can find it later on... It is what the package manager does : it takes an archive (.deb file), open it, and basically, put the files in the right places.
In conclusion, you have to open your .deb file with the package manager.
or, event better, install it through the software center.
You probably already had google-chrome installed on your computer.
A deb file contains all the necessary files to install it with dpgk (as root):
dpkg will copy binaries to you binary files location and then the command google-chrome will be available in your shell. If you didn't do this nor used an apt-get to install google chrome, I guess it means that google chrome was already present on your system.
If you want to see what the deb fils contains, you can use:
There are chromium and chrome if I'm not mistaken! It could be any one of those you already install.