Questions tagged [file-types]
The file-types tag has no usage guidance.
46
questions
2
votes
1
answer
56
views
Most thorough way to determine the user-perspective "type" of a file in Linux?
I am looking (in a file-manager sort of application) to provide the most pertinent natural-language description of what kind of a file each file in a directory is. There seem to be several command-...
3
votes
1
answer
471
views
wrong filetype for extension
I have some octave files, ending with the default .m extension.
In file, I am getting it as ASCII text:
file euler.m
euler.m: ASCII text
and plain text icon in nautilus.
How I can assign .m ...
3
votes
1
answer
225
views
File types recognized in the GUI, but not on command line
I recently realized that file on Debian Bullseye won't recognize some of the file formats I'm dealing with, telling me they are just ZIP files:
user@host:~ $ file file.docx # Correct, not a regular ...
2
votes
0
answers
77
views
'file' command: specifying search depth for 'search' option in /etc/magic file?
How can I specify how far/deep the 'file' command should search in a file to locate a match on a "search" definition ?
I am trying to create a universal specification in "/etc/magic&...
1
vote
0
answers
91
views
How to change file type settings in Ubuntu Beaver?
I noticed that when I looked at my documents folder, there was an XAPK file there. I knew it was there, but Nautilus detected it as a zip file. I was able to change filetype settings before on my RPi, ...
0
votes
1
answer
140
views
show "detailed type" instead of "type" as default in nemo
I would like to differ between SVG, JPEG, PNG images in a folder. It is anoying to always change it, so I want to set "detailed type" instead of "type" as default.
-1
votes
1
answer
91
views
Why do Unix/Linux systems still need to depend on Microsoft?
On an Ubuntu 20.04 system on Intel hardware:
# cd /boot/efi/EFI/
# file $(find . -name '*.efi')
./ubuntu/grubx64.efi: PE32+ executable …, for MS Windows
./ubuntu/shimx64.efi: PE32+ executable …, for ...
1
vote
0
answers
177
views
How to ID images that have extra data attached?
I'm trying to extract images from a complex file. I'm able to break down that file in different sections and extract them all to different files.
The idea then was to use file to detect the type of ...
-1
votes
1
answer
116
views
Does the error mean this file was not created using OpenSSL? If not, how do I figure out what encrypted this file?
When running the below command, I received this error:
OpenSSL> rsautl -decrypt -in binarytext -out file.txt -inkey file2.txt
unable to load Private Key
7324:error:0909006C:PEM routines:get_name:no ...
1
vote
1
answer
422
views
How can I remove source code based file types in linux?
I have a list of raw files that were scraped and it consists of both text and source codes. Below is the filetypes listed and I wanted to remove all files which are of type C Source, python script, ...
6
votes
3
answers
1k
views
Executable common files (*.pdf, etc.)
I have a number of files showing up green when I run ls. I understand these are executables, and I understand that one can make a file executable with chmod. But they are .csv and .pdf files. I don't ...
0
votes
1
answer
86
views
file extensions not working anymore, everything is plaintext
Unsure where to look for this, but since this morning every file I create is of type plaintext.
The last thing I did was remove vim to install the gtk-3 version for python support etc. Just Just ...
14
votes
2
answers
1k
views
How does the file command distinguish text and LaTeX files?
I have a number of files (Jupyter notebooks, .ipynb) which are text files. All of these contain some LaTeX markup. But when I run file, I get:
$ file nb_*
nb_1.ipynb: ASCII text
nb_2....
3
votes
2
answers
2k
views
How many possible file types in the output `ls -l` command?
usually, the possible file types in the output ls -l command are d and -, which represent directory and regular file respectively.
besides above, I saw another type l in the output on macOS.
drwxr-...
1
vote
1
answer
2k
views
Magic file format
From the magic file format manual the format for the rule should be
offset type value message
For example:
0 string MZ
>0x18 leshort <0x40 MS-DOS executable
>0x18 leshort >...
1
vote
1
answer
133
views
How reclaim pdf file type from FoxitReader?
I installed FoxitReader. Now when I look at the detailed listing in my file browser (Thunar), it displays the filetype of any pdf as 'FoxitReader document'.
How do I get it to display simply as PDF?
9
votes
2
answers
6k
views
cat shows nothing
My team is working on a CI environment.
A ko file, named x.ko, is always generated from the CI environment at a regular time everyday and its type is ELF 64-bit LSB relocatable.
Today, I found that ...
0
votes
1
answer
834
views
How to create a 7zip archive of files from a directory, excluding existing archives?
Want to 7zip all files in root/current folder except for all zip-files AND all 7z/7zip files. I can only get one of these to work at a time in one if ! statement:
for file in ./test2/*
do
if ! { ...
23
votes
5
answers
97k
views
How to find files by file type?
I know I can find files using find: find . -type f -name 'sunrise'. Example result:
./sunrise
./events/sunrise
./astronomy/sunrise
./schedule/sunrise
I also know that I can determine the file type ...
1
vote
2
answers
1k
views
How to detect the type of a file in tar.gz
I want to detect the type of a file, which is compressed into a tar.gz, but I don't want to extract it.
In a word, is it possible to execute a command (such as file) onto a file in a tar.gz without ...
2
votes
1
answer
58
views
Changing program used to open file based on file extension
For a college class, I have to download and open .rkt files. In order to open them with the correct program I have to right-click > open with, and if I set a default program, it becomes the default ...
18
votes
2
answers
17k
views
What is anon_inode in the output of "ls -l /proc/[PID]/fd"?
While looking through /proc/[PID]/fd/ folder of various processes, I found curious entry for dbus
lrwx------ 1 root root 64 Aug 20 05:46 4 -> anon_inode:[eventpoll]
Hence the question, what are ...
2
votes
1
answer
59
views
File doesn't seem to be regular but is listed as such
From what I understand, on Linux/UNIX files from which you get system info aren't regular files but rather device files and yet I have encountered a file that doesn't seem to be regular (due to its ...
0
votes
1
answer
404
views
How to download a document from a webpage with wget
I have a web page which contains a link to a document. I'm able to download the document by using the following command:
wget -r -A.doc www.website.com/1.doc
However, I would like to provide the ...
8
votes
1
answer
33k
views
Explain please what is a magic file in unix [closed]
We can create magic files with file -C -m filename. Also there is the /usr/share/file/magic folder with a list of magic files on my OS X machine.
But what is this? Would somebody explain, why ...
1
vote
1
answer
291
views
How are binary files "binary"?
I understand that a binary file is not simple machine code with zeroes and ones. At a meeting yesterday, my colleague stated that we would need a hexdump editor to read binary configuration files for ...
2
votes
1
answer
837
views
Comments in ~/.config/mimeapps.list
I want to add comments in my ~/.config/mimeapps.list file.
How do I do this?
Chapter and verse preferred as errors seem to be silently ignored.
1
vote
0
answers
74
views
Is there a content search program/port (*not* index based) that's efficient for files needing text extraction filters
If using FreeBSD as a file server for windows clients, it's useful to be able to run file searches server-side rather than client-side.
A typical example might be: find all files meeting some ...
2
votes
1
answer
35
views
How to preserve the original extension after multiple files manipulation
This follow is a useful command to add a border to multiple images (require ImageMagick package): convert -border 5x5 -bordercolor "#008000" *.png imgs
The result is that the new files will be named ...
2
votes
0
answers
263
views
List all filename extension associations for a given program
Is there a way of getting all xdg-open's file name extensions that are associated with a given application, eg:
.html -> firefox.desktop
.htm -> firefox.desktop
2
votes
2
answers
1k
views
How to rename misnamed files with their appropriate extensions?
I have a folder with the bulk of files in it of different types, i.e .pdf,.jpg,.png,.tiff etc., but all are named with the extension .JPG. How can I rename all of them with their original extensions? ...
2
votes
1
answer
325
views
How to associate file types on Linux host with Windows applications through VirtualBox?
How can I associate file types in desktop Linux with Windows 7 applications running through VirtualBox so they work seamlessly, starting VirtualBox if required?
I'm using KDE.
Current method
(...
1
vote
1
answer
532
views
Unix decides about the type of a file looking for magic files at fixed offsets. How can it do so reliably?
From https://linux.die.net/man/1/file:
The magic tests are used to check for files with data in particular fixed formats. The canonical example of this is a binary executable (compiled program) a....
0
votes
1
answer
950
views
wget convert tgz file to HTML
I'm trying to download a .tgz file under debian so I decided to use wget for this. This is my command line :
~$ wget http://www.netmet-solutions.org/download/netMETdistrib-4.5_5.8_20160322.tgz
I ...
14
votes
1
answer
7k
views
Setting default application for filetypes via CLI?
I have 150 Debian Jessie machines that open ODS files in Gnumeric when double-clicked despite LibreOffice Calc being installed. I know it is possible to change this by right-clicking the ODS file and ...
1
vote
0
answers
1k
views
How can I open a MIME-formatted file?
On several distributions of Linux, there is a utility called xdg-open, which opens a file in the default application for that particular file type. E.g., for HTML files, it might open firefox.
A MIME-...
1
vote
1
answer
5k
views
linux64 extension
I'm trying to install a program (Teensyduino) on Xubuntu 16.04, but the executable installation file has a .linux64 extension. I've tried running the following commands to open it
sudo ./...
-1
votes
1
answer
159
views
File Stat Program [closed]
I have a simple program which prints whether a pathname argument is either a directory, regular file with execute privileges, a regular file, a symbolic link, or other.
I have the following if ...
6
votes
1
answer
2k
views
Unknown Filetype in ls
In general, what are the reasons why a filetype might show as unknown (?) in ls output?
See the first bit for the file /sbin/start-stop-daemon, which should indicate - for "regular file", instead is ...
2
votes
1
answer
5k
views
How to convert chromium os bin file from Source Forge to iso?
I want to convert the bin file from source forge I've try to call:
bchunk chromiumos_image.bin chromiumos_image.cue chromiumos_image.iso
but got error:
Could not open BIN chromiumos_image.bin: ...
4
votes
1
answer
2k
views
how can I read a number with file (magic)?
I would like to write the format of a drawing with "file drawing"
Files start like:
CAD
A1
mm
(Blank after A1)
or:
CAD
A00
m
(Blank after "m")
I tried somethings like in the file magic:
0 ...
4
votes
2
answers
6k
views
Sort files into folders, depending on filetype
I have about 2.8TB (yes, terabytes) of data I have recovered, this will be scanned for duplicates, the machine these files reside on is quite old and only has 2GB of memory (works fine for LVM, ...
2
votes
2
answers
3k
views
magic example using search and/or regex
I am trying to have the file command detect some Windows text files that were never meant to be classified by file... The best choice seems to use regex to match the line content, but I cannot find a ...
-1
votes
1
answer
91
views
Problem using SAP site
My father's company site uses SAP. He's trying to move to Linux (tired of Windows' bugs, problems and viruses) but he can't natively use the site's functionalities. When he tries to open those a popup ...
2
votes
3
answers
1k
views
Bash script to count file types in a path (including subfolders)
I would like to get a quick overview over the different file types in a directory (including all its subdirectories) using the file tool, e.g. telling me what file type is the most common one there.
...
11
votes
4
answers
43k
views
How to use wc and piping to find how many files and directories are in a certain directory?
How can I use word counter (wc) and piping to count how many files or directories are in the /usr/bin directory?