# Linux——文件内容如何查看

> 来源：梦飞idc云平台 | 原文：https://www.mfisp.com/14515.html | 发布：2022-12-16 | 更新：2022-12-16 | 分类：建站教程、投稿分享

**（****touch stat du****）**

 

**stat****查看文件状态信息**

 

[root@fengdeyong lianxi]# stat hejin.txt

 

File: hejin.txt

 

Size: 0 Blocks: 0 IO Block: 4096 regular empty file

 

Device: fd00h/64768d Inode: 52727069 Links: 1

 

Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)

 

Context: unconfined_u:object_r:default_t:s0

 

Access: 2021-03-28 10:31:12.989701564 +0800

 

Modify: 2021-03-28 10:17:21.719671835 +0800

 

Change: 2021-03-28 10:17:21.719671835 +0800

 

Birth: -

 

**linux里的文件有3个时间**

 

1.access time --》atime 访问时间 --》你查看了文件里的内容 vim，cat

 

2.change time --》ctime 改动时间 --》改动了文件的属性， 例如用户，组，权限，大小，时间，文件名等

 

3.modify time --》mtime 修改时间 --》修改文件里的内容

  

**touch****命令（新建空文件，或更新文件时间标记）**

 

touch file 新建空文件

  

**du -sh dicr1(****查看文件或文件夹的占用情况****)**

 

du --> disk usage

 

-sh --> summarize human-readable

 

遇到结束的进程，无法访问怎么办？

 

**du -sh / 2>/dev/nul**l 出错的信息不显示杂屏幕上，重定向到/dev/null

 

2> 错误信息重定向

---
本页由 梦飞idc云平台（https://www.mfisp.com）提供。站点导航见 https://www.mfisp.com/llms.txt
