First thing I noticed when switched from Windows to Linux was, that Linux has no strict naming convention and no obligatory file name extensions like .bmp, .jpg, .exe etc. Therefore I can not tell by the file name itself its file format.   If all JPEG files on my file system had the .jpg extension, I could simply find all JPEG files by:  find / -type f -name "*.jpg"   But if it is not the case I am clueless how to find all JPEG files.
107063
I am searching for a method to find only JPEG files/ With my limited knowledge of Linux I came to this point:   list all paths that exist from root below with find / pipe the result into next command and perform the file command on each found path with xargs file In the result of the file command is a JPEG string contained, I thought maybe it would be possible somehow to an IF-statement to filter only the JPEGs: If (JPEG contained in output of file command) {show argument of file}   once more:  find / | xargs file | "If statement"    Could you please correct me, give me a hint how to perform the task or give a solution?
95308
Windows still uses ~ for shortening files and directories with long names. You can see the "short" name by typing dir /X in the command prompt.  My question is how are the digits assigned to the short file names? It doesn't seem to be alphabetical nor does it seem to work by file creation time.  For example:  I create a new text file: C:\reallylongfilenameB.txt  Then I run dir /X and see the short name of fileB is REALLY~1.TXT  I create a second text file: C:\reallylongfilenameA.txt  Then I run dir /X and see the short name of fileA is REALLY~2.TXT  Then I set the clock back a day, delete C:\reallylongfilenameA.txt and then re-create it, essentially making the create date of C:\reallylongfilenameA.txt 1 day before C:\reallylongfilenameB.txt.  I run dir /X and C:\reallylongfilenameA.txt short name is still REALLY~2.TXT.  Given this example, is there any way to make the short name of C:\reallylongfilenameA.txt be REALLY~1.TXT?
27334
when we specify the file path some times we specify like ./filename and some time ../filename what is difference between these two?
86509
I am trying to find data from files using grep, but grep usually prints out the filename as well as the line where the term is found.  In this case, I am looking for a special regexp and I want grep to print all items matching the regexp, not the line or the filename. In other words, I want to see only the matched regular expression.
76835
Where are filenames stored on a filesystem?  It's not in inode or with the actual file content since we have hard link that two filenames can point to the same inode.
92593
If I want to create a new file extension for a binary/text data file that will open on my own application (extension ".mylongfileextensionname" for example), will Windows list it with my aplication (considering that I already listed it on Windows Registry before)?  There is a length limit, I mean, on my example should I use ".mylong" or any specific layout?
37790
As the question goes, how does Ubuntu know what file type a file without extension is?  When I save a file as "Untitled Document" without any extension, how does it know? Same thing for video and music formats...
97364
I would like to know how file types are known if filenames don't have suffixes.  For example, a file named myfile could be binary or text to start with, how does the system know if the file is binary or text?
98998
I need to do create a file with a filename such as :&gt;?, is this possible somehow? Windows stops it.
115979
I wish to tar all files in a directory and its subdirectories that do NOT end in .jpg, .bmp, .gif, or png.  So, given the following folders and files:  foo/file.txt foo/file.gif foo/bar/file foo/bar/image.jpg   I want to tar only the files file.txt and file. file.gif and image.jpg should be ignored. I would also like to maintain the folder structure.  My first thought was to pipe the results of the find command in conjunction with grep -v ".jpg|.gif|.bmp.png" to a text file, and then use the tar include argument to feed it that list of files.   However, the results of the grepped find command also contain directories (in the example above, it would be "foo" and "foo/bar"), and when a directory is fed to tar, it includes all files in that directory, so I would end up with a tar file containing all of the files--not what I want.  Is there any way to prevent find from outputting directories? Is there a far easier way to approach this?
105999
Traditionally  at the end of a filename after uploading it via the image uploader. That doesn't seem to work any more. I've tested it on Q&amp;A as well as chat.        (Yes, I know big M doesn't work)  Could we have this fixed please?
99279
I'd like to find where a file (with a partially-known filename) is in the file system.  I'd like to know how to do this from the command line, rather than using a GUI utility.  In Windows, I'd run the following:  cd /d C:\ dir *filename* /s   What's the Linux equivalent?
16320
When I'm using  find . -type f -name "*.htm*" -o -name "*.js*" -o -name "*.txt"  it finds all the types of file. But when I add -exec at the end:  find . -type f -name "*.htm*" -o -name "*.js*" -o -name "*.txt" -exec sh -c 'echo "$0"' {} \;  it seems it only prints .txt files. What am I doing wrong?  Note: using MINGW (Git Bash)
101226
My goal is to find a Linux command sequence, which deletes some files if a special condition is fulfilled:  All files with the extensions .cut or .cut.bak in the current directory shall be removed, IF there is no file having the same name, but extension .rec or .mpg in the current directory.  Background: I am developing a tool for a Linux-based PVR, that allows cutting of recorded programs. For each recording (extension .rec or .mpg) the segment markers are stored in a .cut-file with the same name. When some recording gets moved/renamed/deleted, then the corresponding cut-file remains orphaned and shall be deleted. I already have implemented the removing of those useless cut-files in C. But I am wondering, whether there may be a (simple) system based solution. In this case it could be run via 'system' and &amp; in the background, which would make my application more responsive...  I already asked a similar question for the recursive case (browsing also into subdirectories), . There has been a (nearly) perfect answer by kos - but unfortunately it removes too many files, so it is not usable, and I was not able to figure it out... But the same idea can be used here, IF it is possible to parse and pipe the result of 'ls' linewise...
10337
Why do we use ./filename to execute a file in linux?  Why not just enter it like other commands gcc, ls etc...
103150
I use this program in Windows that's one-box and searches all of my drives. By default it lists all files, everywhere, in a single list. Is there a Linux graphical utility that does this?
15969
Is there any way I can search based on the last three digits of a file name?  I have a file with many invoices that are easy to reference with the last three numbers. Is there any way I can search something like *765 to search for ends with 765  Another example.. sometimes files are prefixed with a 0, sometimes not.. 093241251 vs 93241251 and if I just search 93241251 it will not find the 0 prefix version