---
title: "维护Linux服务器常用命令"
author: "xitong"
date: "2013-05-09T11:48:00Z"
tags: []
slug: "linux"
draft: false
lastmod: "2013-05-09T13:48:06Z"
id: 1865100
url: "https://xitong.iteye.com/blog/1865100"
---

Linux常用命令

1.查看硬盘使用情况  
df –h，如：  
![](http://img.blog.csdn.net/20130509115008581)

2.强制删除静态文件  
rm –rf fileName\*，如：  
![](http://img.blog.csdn.net/20130509115112171)  
如果没有相同的文件名，可以查看类似的文件，如：  
rm –rf fileName  
![](http://img.blog.csdn.net/20130509115143701)

3.要删除实时更新的文件，不能直接使用rm删除，需要使用如下命令  
echo “”&gt;fileName，如：  
![](http://img.blog.csdn.net/20130509115222109)

4.查看文件夹大小  
du –sh，如  
![](http://img.blog.csdn.net/20130509115249452)

5.查看文件夹下文件的大小  
du –sh \*，如：  
![](http://img.blog.csdn.net/20130509115315889)

6.查看内存、进程、负载，这个比较安全  
top，如：  
![](http://img.blog.csdn.net/20130509115343276)

7.查看文件翻页技巧，当文件很大时，需要翻页查看  
more fineName，如：

![](http://img.blog.csdn.net/20130509115422231)  
当某命令很输出很多时也可以使用more，在命令后家“|more”，如：  
![](http://img.blog.csdn.net/20130509115450508)