• 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

file: command not found

by admin

A file name is a string of characters that identify a file. By using the right combination of characters in file names, you can ensure that the files are unique and easy to recognize.

On an ext4 file system, a file name may be up to 255 bytes long and contain any byte except NULL (\0) and the forward slash (/). File names of user files may not be . and .. as these are special reserved file names. Various file systems may enforce different requirements for file names.

The file command is used to determine the type of file. The syntax of the command is:

file [options] {file names}

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

file: command not found

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

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

file Command Examples

1. Give a description of the type of the specified file. Works fine for files with no file extension:

# file filename

2. Look inside a zipped file and determine the file type(s) inside:

# file -z foo.zip

3. Allow file to work with special or device files:

# file -s filename

4. Don’t stop at first file type match; keep going until the end of the file:

# file -k filename

5. Determine the mime encoding type of a file:

# file -i filename

Filed Under: Linux

Some more articles you might also be interested in …

  1. module Command Examples in Linux
  2. cockpit-ws Command Examples in Linux
  3. battop Command Examples in Linux
  4. qtchooser Command Examples in Linux
  5. nano: command not found
  6. gv2gxl Command Examples
  7. “kubectl rollout” Command Examples
  8. corepack: Zero-runtime-dependency package acting as bridge between Node projects and their package managers
  9. wdctl Command Examples in Linux
  10. dirb: command not found

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