# Linux小技巧

## 优雅的清空日志

```
cat /dev/null > xxx.log
```

## 磁盘沾满但是找不到大文件

这种情况可能是文件被删掉了，但是仍然被进程占用，磁盘空间没有释放导致的，删掉占用进程就可以了。查找删除文件的占用进程：

```
lsof|grep del
```

> 参考：
>
> <https://www.cnblogs.com/276815076/p/3503923.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jun-wang.gitbook.io/learnjava/ji-shu-xue-xi/linux-xue-xi/linux-xiao-ji-qiao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
