`~/.local/bin` not used

I understand that ~/.local/bin is the standard location for scripts. So I’ve put a script there made it executable but when I type the name from the console it says bash: script: command not found... What is wrong?

ls -l ~/.local/bin/YOUR_SCRIPT
file ~/.local/bin/YOUR_SCRIPT

# Fix maybe:
chmod +x ~/.local/bin/YOUR_SCRIPT

so there is ~/.local/bin and ~/bin? Sound a bit overkill to me*

EDIT: I have no ~/bin on my system. (lucky me)

runnig ~/.local/bin/script from the prompt runs fine.

Like I wrote it already sits there and is executable and before you ask

$ echo $PATH
/home/j/.local/bin:/home/j/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/j/.composer/vendor/bin

*) and of course /bin, /usr/bin, /usr/local/bin which all are totally overkill and remnants from the silly past of time-share systems.

script is the name of a standard command in /usr/bin.
Assuming your shell is bash, the location of script is probably hashed.
What gives: type -p script and type -a script

I’ve been using that directory for year without issue

leigh@leigh-pc:~$ which rpmfusion-post-sign 
~/.local/bin/rpmfusion-post-sign
leigh@leigh-pc:~$ echo $PATH
/home/leigh/.local/bin:/home/leigh/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin
leigh@leigh-pc:~$ ls -l /home/leigh/.local/bin
total 248
-rwxr-xr-x. 1 leigh leigh   542 Nov  1  2025 create2github
-rwxr-xr-x. 1 leigh leigh  8972 Nov  1  2025 cvstogit
-rwxr-xr-x. 1 leigh leigh 11188 Nov  1  2025 find_failures.py
-rwxr-xr-x. 1 leigh leigh   737 Nov  1  2025 koji-keep-latest
-rwxr-xr-x. 1 leigh leigh  1522 Nov  1  2025 mashism
-rwxr-xr-x. 1 leigh leigh  1210 Nov  1  2025 mashism-el
-rwxr-xr-x. 1 leigh leigh   843 Nov  1  2025 mashism-nvidia-driver
-rwxr-xr-x. 1 leigh leigh   835 Nov  1  2025 mashism-steam
-rwxr-xr-x. 1 leigh leigh   842 Nov  1  2025 mashism-tainted
-rwxr-xr-x. 1 leigh leigh   840 Nov  1  2025 mashism-tainted-el
-rwxr-xr-x. 1 leigh leigh  8743 Nov  1  2025 mass-rebuild.py
-rwxr-xr-x. 1 leigh leigh  6646 Nov  1  2025 mirror-kernel-devel-pkgs.sh
-rwxr-xr-x. 1 leigh leigh   325 Nov  1  2025 pkgs2github
-rwxr-xr-x. 1 leigh leigh   979 Nov  1  2025 rpm-dispatch
-rwxr-xr-x. 1 leigh leigh   714 Nov  1  2025 rpmfusion-clean-up
-rwxr-xr-x. 1 leigh leigh   600 Nov  1  2025 rpmfusion_free-el-sync
-rwxr-xr-x. 1 leigh leigh   612 Nov  1  2025 rpmfusion_free-fedora-sync
-rw-r--r--. 1 leigh leigh   232 Nov  1  2025 rpmfusion-free-multilibs
-rwxr-xr-x. 1 leigh leigh   251 Nov  1  2025 rpmfusion-keep-latest
-rw-r--r--. 1 leigh leigh   107 Nov  1  2025 rpmfusion-liste-cuda
-rw-r--r--. 1 leigh leigh  5663 Nov  1  2025 rpmfusion-liste-free
-rw-r--r--. 1 leigh leigh  2702 Nov  1  2025 rpmfusion-liste-nonfree
-rw-r--r--. 1 leigh leigh    92 Nov  1  2025 rpmfusion-liste-rpi
-rwxr-xr-x. 1 leigh leigh   609 Nov  1  2025 rpmfusion_nonfree-el-sync
-rwxr-xr-x. 1 leigh leigh   621 Nov  1  2025 rpmfusion_nonfree-fedora-sync
-rw-r--r--. 1 leigh leigh   287 Nov  1  2025 rpmfusion-nonfree-multilibs
-rwxr-xr-x. 1 leigh leigh  2018 Nov  1  2025 rpmfusion-old-sign
-rwxr-xr-x. 1 leigh leigh  5640 Nov  1  2025 rpmfusion-post-sign
-rwxr-xr-x. 1 leigh leigh   470 Nov  1  2025 rpmfusion-pre-sign
-rwxr-xr-x. 1 leigh leigh   326 Nov  1  2025 rpmfusion-regen-repos
-rwxr-xr-x. 1 leigh leigh   332 Nov  1  2025 rpmfusion-repocheck
-rwxr-xr-x. 1 leigh leigh  5854 Nov  1  2025 rpmfusion-repotrack
-rwxr-xr-x. 1 leigh leigh   494 Nov  1  2025 rpmfusion_root-sync
-rwxr-xr-x. 1 leigh leigh  1507 Nov  1  2025 rpmfusion-sign
-rwxr-xr-x. 1 leigh leigh  1062 Nov  1  2025 rpmfusion_sync
-rwxr-xr-x. 1 leigh leigh   593 Nov  1  2025 rpmfusion_sync_el
-rwxr-xr-x. 1 leigh leigh   473 Nov  1  2025 rpmfusion_sync_nvidia-driver
-rwxr-xr-x. 1 leigh leigh   450 Nov  1  2025 rpmfusion_sync_steam
-rwxr-xr-x. 1 leigh leigh   460 Nov  1  2025 rpmfusion_sync_tainted
-rwxr-xr-x. 1 leigh leigh   449 Nov  1  2025 rpmfusion_sync_tainted_el
-rwxr-xr-x. 1 leigh leigh   999 Nov  1  2025 rpmfusion-update-appstream
-rwxr-xr-x. 1 leigh leigh  1277 Nov  1  2025 rpmfusion-update-appstream-nvidia
-rwxr-xr-x. 1 leigh leigh  1239 Nov  1  2025 rpmfusion-update-appstream-steam
-rwxr-xr-x. 1 leigh leigh  1122 Nov  1  2025 rpmfusion-update-report
-rwxr-xr-x. 1 leigh leigh   153 Nov  1  2025 run_failed_to_build.sh
-rwxr-xr-x. 1 leigh leigh 18153 Nov  1  2025 sigulsign_unsigned.py
-rwxr-xr-x. 1 leigh leigh   789 Nov  1  2025 tested-packages.sh
-rwxr-xr-x. 1 leigh leigh  1988 Nov  1  2025 watch-fedora-packages.sh
leigh@leigh-pc:~$ ls -l /home/leigh/.local/
total 12
drwxr-xr-x.  3 leigh leigh 4096 Nov  1  2025 bin
drwx------. 69 leigh leigh 4096 May  3 20:52 share
drwx------.  3 leigh leigh 4096 May  3 14:08 state
leigh@leigh-pc:~$

I wonder if your login name is effectively j (only one letter long).
If yes I may be jealous since mine is twice as long :slight_smile:

What is the output of:

  id
  echo ~
  type -p script
  type -a script

I deleted my comment. I didnt see properly that OP was already talking about a directory within ~ - sorry for the noise.

On my setup it doesn’t seem to cause problem if the script is called script:

$ cat > ~/.local/bin/script << EOF
#!/bin/bash
echo "hello world"
EOF
$ cat > ~/.local/bin/skript << EOF
#!/bin/bash
echo "good morning"
EOF
$ chmod +x ~/.local/bin/script ~/.local/bin/skript
$ script
hello world
$ skript
good morning

What is the output of which script

It’s not installed by default I suspect. I don’t have it on my system because I’ve never needed to record the output of any stdout/stderr to a file and to be able to replay it back.

Something like this should already be in your ~/.bash_profile or ~/.bashrc, if not just add this in your ~/.bashrc

if [ -d "$HOME/.local/bin" ]; then export PATH="$HOME/.local/bin:$PATH" ; fi

That doesn’t seem to be the issue, because OP already showed us that:

$ echo $PATH
/home/j/.local/bin:/home/j/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/j/.composer/vendor/bin

Is /home/$USER/.local/bin in your $PATH.?
If not then the scripts placed there will not be found without a full pathname when the script is called.
Run echo $PATH to find out.
I see this

$ echo $PATH
/home/USER/.local/bin:/home/USER/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

Yes - OP showed us that earlier.

$ echo $PATH
/home/j/.local/bin:/home/j/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/j/.composer/vendor/bin

The name of the file indicates it may have something to do with kernel drivers from rpmfusion – possibly intended to rebuild the nvidia drivers. If so that would require use of sudo or elevated root privileges and potentially could fail (even if executable) if there is no means of entering the password when the script is called.

Probably just opening a new terminal solves the issue.

The rights on the folder bin I hav is 0755

 stat bin
  File: bin
  Size: 2804      	Blocks: 0          IO Block: 4096   directory
Device: 0,51	Inode: 43711       Links: 1
Access: (0755/drwxr-xr-x)  Uid: ( 1000/ ilikelinux)   Gid: ( 1000/ ilikelinux)

Do you give this information to your scripts?

#!/bin/bash