• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dir: command not found

by Deepika

dir command in Linux lists the directory contents using one line per file. The special characters are represented by backslash escape sequences. This works similar to the command:

# ls -C --escape

If you encounter the below error while running the command dir:

dir: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install coreutils
Ubuntu apt-get install coreutils
Alpine apk add coreutils
Arch Linux pacman -S coreutils
Kali Linux apt-get install coreutils
CentOS yum install coreutils
Fedora dnf install coreutils
OS X brew install coreutils
Raspbian apt-get install coreutils

dir Command Examples

1. List all files, including hidden files:

# dir -all

2. List files including their author (`-l` is required):

# dir -l --author

3. List files excluding those that match a specified blob pattern:

# dir --hide=pattern

4. List subdirectories recursively:

# dir --recursive

5. Display help:

# dir --help

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Find and Delete Empty Directories and Files in Linux
  2. pwck Command Examples in Linux
  3. foreman: command not found
  4. protonvpn-cli Command Examples in Linux
  5. gifdiff: Compare two GIFs for identical visual appearance
  6. btrfs filesystem Command Examples in Linux
  7. “git merge-into” Command Examples
  8. watch command examples to run a command repeatedly or monitor dynamically changeable files (like /proc/*)
  9. LVM Configuration : Volume Group (VG) Operations/Utilities
  10. git describe: Give an object a human-readable name based on an available ref

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright