I want to install a .sh

I downloaded a .sh and want to install it.

I go into Terminal, cd /home/USERNAME
No problem.

Command ls
get a listing of directories in USERNAME@USERNAMEHome

I go cd /home/USERNAME/downloads:
bash: cd: ../home/USERNAME/downloads: No such file or directory

How do I get into the downloads folder to install the .sh file?

From terminal opened in home:

cd ~/Downloads

The tilde (~) is shorthand for /home/USERNAME

If you navigate to the Downloads directory, then you cannot cd into what you are already inside of, as it would be looking for another directory named Downloads from within that folder.

1 Like

Firstly, please try to use Preformatted text (either by manually typing backticks ` or clicking the </> button in the post editor) for bits of code and terminal output, to make it more readable. Especially when you're mixing text and commands/output in the same line.

Secondly, in linux, there is a sort of shortcut for accessing your* home folder (/home/USERNAME) which is the squiggle tilde: ~. So both of these commands would navigate you to your Downloads folder:

cd /home/USERNAME/Downloads
cd ~/Downloads

*this shortcut is specifically for the currently-active user only, so in a multi-user system or when acting as root, ~/ may not be your home folder!

Pro tip: folder paths are case-sensitive, but you can use the Tab button on your keyboard to auto-complete as long as you get the first few letters correct.

Finally, there isn't really such a thing as "installing" a .sh file. They're just executable scripts. If you want it to always be easy to run it from the command line, you could copy it somewhere in your PATH...? I'm not sure what is the best / most correct location in PATH to copy random scripts, but if you run echo $PATH you'll get a colon-separated list of folders and you'll want to pick one that's inside your home folder. Maybe ~/.local/bin?

Otherwise, you can always run it from anywhere by just typing the full folder path to the file like /home/USERNAME/Downloads/some-script.sh.

3 Likes

You could simply go in Nautilus and there to the Downloads Folder. And there You go to the 3 Dots at the Directory Line, click on it and then chosse the Option to open this in Terminal:

I think the Problem is that ''downloads'' is written with a small d instead of a big D. You should try cd /home/USERNAME/Downloads

1 Like

Oh yes, I noticed Linux is serious about capitalisation, that was indeed my error.

1 Like

Thank you for the advice about Preformatted text. I wondered how to do it, now I know, I will keep this in mind for the future. Thank you once again.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.