Check the Path First
pwd
ls -l /path/to/file
namei -l /path/to/file
file /path/to/fileThe missing thing is not always the file you named. pwd shows where you are, and ls -l shows whether the path exists. namei -l walks the path one part at a time, with owner and permissions for each, and shows where it breaks. file tells you what kind of file is there; install the file package if it is missing.
1. A Typo or Wrong Letter Case
Linux names are case-sensitive: Config.php and config.php are different files. A name with a space must be quoted, or the shell splits it into two names: ls -l "backup 2026.tar.gz". A name that looks right may carry an invisible character, such as a trailing space; ls | cat -A shows it, as explained in the cat command guide.
2. A Relative Path from the Wrong Folder
A path without a leading / is relative to the current folder, so ./deploy.sh works in the project folder and fails anywhere else. This is the usual reason a script works when you run it and fails from cron: cron normally starts jobs in the user's home folder, not in the folder that holds the script. Use absolute paths in scripts and cron jobs, or change to the right folder at the start of the script; see the cd command guide and how to list cron jobs.
3. A Missing Parent Folder
Writing a file fails with this error when the folder it should go into does not exist: echo test > /var/log/app/test.log fails if /var/log/app is missing. Redirects, cp, and most programs that write logs do not create missing folders. Create the folder first, as the mkdir guide shows:
sudo mkdir -p /var/log/app4. A Broken Symbolic Link
ls -l /etc/nginx/sites-enabled/
readlink -f /etc/nginx/sites-enabled/example.com
find /etc/nginx -xtype lA link whose target was moved or deleted still shows up in ls, but opening it fails with this error. find -xtype l lists every broken link below a folder. Point the link at the right target again; see how to create a symlink in Linux.
5. A Script That Names a Missing Interpreter
When a script runs, the system reads its first line, such as #!/bin/bash, and starts that program. If the program does not exist, the error names the script, which is confusing; bash reports it as a "bad interpreter". Check the first line:
head -1 deploy.sh | cat -A
file deploy.shIf the line ends in ^M$, the file has carriage-return line endings from another system, and the kernel looks for a program whose name ends in an invisible carriage return; file reports CRLF line terminators. Convert it with sed -i 's/\r$//' deploy.sh, or with dos2unix deploy.sh from the dos2unix package. If the line names a program that is not installed, such as #!/usr/bin/python on a system with only python3, change it to #!/usr/bin/env python3. which python3 shows whether and where a program exists, and command not found covers missing programs.
6. A Program That Exists but Will Not Start
file ./program
readelf -l ./program | grep interpreter
objdump -p ./program | grep NEEDEDA compiled program can fail with this error although ls shows it: the missing file is its loader, the system library that starts it. The usual case is a 32-bit program on a 64-bit server; file reports a 32-bit ELF file and names an interpreter such as /lib/ld-linux.so.2. On Debian and Ubuntu, install the 32-bit C library with sudo dpkg --add-architecture i386, sudo apt update, and sudo apt install libc6:i386. On AlmaLinux and Rocky Linux 9 the package is glibc.i686; release 10 no longer ships 32-bit libraries, so use a 64-bit build of the program there. readelf and objdump, from the binutils package, only read the file: the first shows the loader it asks for, the second the libraries it needs. ldd ./program also marks missing libraries as not found, but never run it on a program you do not trust, because it can run code from it. x64 vs x86 explains the architectures.
7. A File on a Disk That Is Not Mounted
findmnt /mnt/data
lsblkIf a data disk did not mount at boot, its mount point is an empty folder and every path below it is missing. findmnt prints nothing for a path that is not a mount point, and lsblk shows whether the disk is mounted anywhere. See how to mount a drive in Linux.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations