Typically, files have extensions, such as .txt
and .csv
, that indicate the type of the file, and are used to determine the default program to open these files in Windows. For instance, on Windows, a text editor will be the default program to open files with the .txt
extension.
Rather than relying on extensions to determine file type, Unix-based operating systems such as Linux use media types, also called MIME types. The MIME type application/pdf
indicates that a file is a pdf
, and the MIME type image/png
indicates that a file is a png
image. The first part of a MIME type string is the type, such asapplication
, or image
, and the second part is the subtype, such as pdf
, or png
.
There are MIME types for every type of file. MIME types are stored in the file metadata, which is stored as part of the file. Because of this, Linux can figure out the type of a file and open it properly even if it doesn't have an extension.
You can rename files and remove extensions whenever you want, and you'll often run across files without extensions, such as test
.
Specifying a folder as the second argument tomv
will preserve the file name, and move it into the folder. If you instead specify a full path, including filename, it will move the original file to the new file name, essentially renaming it. For example, mv test.txt test2.txt
will move the file test.txt
to test2.txt
. This will basically rename test.txt
.
Instructions
- Rename
test.txt
in the/home/dq/test
folder totest_no_extension
.
mv test/test.txt test/test_no_extension