Why doesn't the shell find a file inside the current directory by its name alone?
What you experience is not related to the shell, but to how the apt
command interprets the arguments on the command line.
It is primarily aimed at installing packages from the software repositories. By default, an argument to apt
means the name of a package in the software sources. The message:
E: Unable to locate package vs.deb
clearly indicates that a package vs.deb
does not exist in the software sources.
Still, apt
allows you to directly install a downloaded .deb
package file and resolve dependencies for it. You must give an explicit file path to indicate you want to install a .deb
file. ./vs.deb
already indicates a file path: ./
means the current directory, so apt will find the vs.deb
file in the current directory.
Actually, it is never the shell that "finds" a file. The shell just passes arguments to the application, and it is up to the application to interpret these arguments. At most, the shell does expansion (e.g. replacing *
with all filenames or ~
with the full path of your home folder) or variable substitution (e.g. $HOME
is replaced by the content of that variable).