• 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. mt: command not found
  2. ncview: command not found
  3. “Volume “myvg/vol01″ Is Not Active Locally” – CentOS/RHEL
  4. grub-script-check: command not found
  5. CentOS / RHEL : Configure yum automatic updates with yum-cron service
  6. How to Change the default kernel (boot from old kernel) in CentOS/RHEL 8
  7. add-apt-repository Command Examples
  8. How To Enforce Password Complexity For All Users, Including “root”, By Using the “passwdqc” PAM Module CentOS/RHEL
  9. How to use sudo to allow a non-root user run a particular command
  10. Linux / UNIX : Examples of find command to find files with specific sets of permissions

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright