博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
File Extensions
阅读量:5944 次
发布时间:2019-06-19

本文共 1573 字,大约阅读时间需要 5 分钟。

hot3.png

Typically, files have extensions, such as .txtand .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/pngindicates 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

转载于:https://my.oschina.net/Bettyty/blog/746441

你可能感兴趣的文章
xttprep.tmpl
查看>>
mycat垂直分库
查看>>
无需停机,手把手教您将 Docker CE 切换为 Docker EE
查看>>
Ubuntu 14.04 Web服务器,Apache的安装和配置
查看>>
MaxCompute 图计算用户手册(上)
查看>>
自带科技基因,打造纯原创IP,“燃烧小宇宙”获数千万A轮融资
查看>>
未能加载文件或程序集"Newtonsoft.Json, Version=4.5.0.0
查看>>
C#多线程编程系列(二)- 线程基础
查看>>
Jenkins 内置变量(学习笔记二十四)
查看>>
PostgreSQL 10.1 手册_部分 II. SQL 语言_第 13 章 并发控制_13.2. 事务隔离
查看>>
虚拟机概念
查看>>
【云周刊】第195期:全球首家!阿里云获GNTC2018 网络创新大奖 成唯一获奖云服务商...
查看>>
【VS】使用vs2017自带的诊断工具(Diagnostic Tools)诊断程序的内存问题
查看>>
AutoScaling 支持从实例启动模板创建实例
查看>>
Mysql 查看视图、存储过程、函数、触发器
查看>>
Java提高篇(二):IO字节流、字符流和处理流
查看>>
云HBase集群的规划
查看>>
hello dato--graphlab create
查看>>
一个优质男朋友的标准
查看>>
浩鲸科技和京东加入 OpenMessaging 开源标准社区
查看>>