• 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

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. apparmor_status: command not found
  2. fwupdmgr: command not found
  3. paste: command not found
  4. How to configure AD group in sudoers file to provide sudo access to users on Linux system
  5. How to tar, untar files and view contents of tar file under Linux
  6. finch: command not found
  7. bmon Command Examples in Linux
  8. How To Install Python 3 On CentOS 7 Using SCL
  9. Adding static entry into system ARP cache (CentOS/RHEL)
  10. chntpw Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)
  • “az storage account” Command Examples (Manage storage accounts in Azure)
  • “az sshkey” Command Examples (Manage ssh public keys with virtual machines)
  • “az redis” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright