Having troubles installing CLI

Okey, I’m trying to download the CLI right? I think I messed up when I move the exercism file to the $PATH in the ~/bin directory. and instead of moving it I renamed the file, and deleted original ‘~/bin’. I remake the link to /bin folder with command ‘ln -s /bin ~/bin’. Then, I move the exercism file to ~/bin folder but now shows another error:
image

don’t know what to do now. Any advice or help would be appreciated.

/bin and ~/bin are entirely different directories.

/bin is the system directory that holds all the system executables. You do not want to touch that manually.

~/bin or $HOME/bin is a local user directory which should not have any system-wide files. You should not be linking (ln) the two.

You should not be using sudo for any of this setup. The setup should be a userspace only operation and should not touch any system files or settings.

Hopefully ls /bin shows your system executables. There should be roughly somewhere between 50 and 500 files in here.

ls ~/bin should show your local ~/bin directory which should have whatever you put in there. You should see exercism in there. If you don’t, you will need to copy/move (cp, mv) the exercism executable into ~/bin from where ever you downloaded it.

If you do see exercism inside ~/bin and it is not executable, you will need to run chmod 755 ~/bin/exercism to mark it as executable.

What Isaac said. I assume the reason you linked /bin and ~/bin is because that way, things you put in ~/bin are in your PATH? If so, the standard way to make executables in your home directory discoverable via PATH is by adding this to your .bashrc or .zshrc:

export PATH="$PATH:$HOME/bin"

This will take effect after you restart your shell.

if I actually linked the two directories, what should be the better way to unlink them and move the exercism file to the new one. I made this connection because both directories seemed to be identical, I list ~/bin before deleting by accident, and then I list the /bin and, at least apparently, showed the same files and directories.

ln -s /bin ~/bin would create a symlink (like a Windows “shortcut”) named ~/bin pointing to /bin. You can verify this by running ls -dl ~/bin. You should see something that includes jesus jesus Jul 18 2023 /home/jesus/bin -> /bin. That’s a shortcut/pointer symlink and is safe to delete.

You can use rm ~/bin to remove it. If the user/group shows root root instead of jesus jesus only then do you need “root” privileges to remove it; in that case, you can use sudo rm ~/bin to remove the symlink.

Once you’ve removed the symlink, you can make a ~/bin directory by running (without sudo) the mkdir ~/bin directory to create your own non-system user bin directory. Once created, you can move /bin/exercism into it. Once more, you might need sudo to move that file if it is owned by root. You can check using ls -l /bin/exercism. If it shows root root then you need sudo mv /bin/exercism ~/bin. Otherwise, that command ought to work without sudo. After running the mv, you should have a local ~/bin/exercism command. You can add ~/bin to your PATH, verify the command is executable (eg by running ~/bin/exercism) and you’re off to the races.