Error Codes Wiki

Linux errno 2 (ENOENT) — No Such File or Directory

Warningerrno

Overview

Linux errno 2 (ENOENT) means the specified file or directory does not exist at the given path.

Key Details

  • ENOENT — most common Linux error
  • Path component does not exist
  • Can occur with files, directories, sockets, or devices
  • Shell may show "No such file or directory" message

Common Causes

  • File path is misspelled or incorrect
  • File was deleted or moved
  • Symbolic link points to non-existent target
  • Missing directory in the path hierarchy

Steps

  1. 1Verify the path exists: ls -la /path/to/file
  2. 2Check for typos in the filename or path
  3. 3Check symlinks: ls -la to see if link target exists
  4. 4Use find or locate to search for the file

Tags

linuxerrnoerrno 2 enoenttroubleshootingfix

More in Errno

Frequently Asked Questions

Check the full path — a parent directory may not exist, or there may be invisible characters.