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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. playerctl Command Examples in Linux
  2. squeue: command not found
  3. stress Command Examples in Linux
  4. CentOS / RHEL 7 : GRUB2 configuration file /boot/grub2/grub.cfg explained
  5. How to schedule Jobs with Cron in Linux
  6. ark: command not found
  7. nixos-option: Command Examples in Linux
  8. i3: command not found
  9. How to delete a partition using fdisk
  10. How to add header and trailer line to a file in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • csslint: A linter for CSS code
  • csh: The shell (command interpreter) with C-like syntax (Command Examples)
  • csc: The Microsoft C# Compiler (Command Examples)
  • crystal: Tool for managing Crystal source code

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright