---
title: "搜集一下linux命令"
author: "successfulroof"
date: "2012-11-22T16:18:46Z"
tags: []
categories: ["编程语言"]
slug: "linux"
draft: false
lastmod: "2012-11-30T10:45:09Z"
id: 1733391
url: "https://fucky.iteye.com/blog/1733391"
---

给target目录授权

**sudo -u admin chmod 755 target** 

 

数一下这个文件有多少行

wc -l filename 

 

数一下这个文件多少个word

wc -w filename

 

数一下最长的一行是多少个word

wc -L filename

 

定时清理日志

\*/7 * * * * &gt; /home/admin/logs/tddl/tddl-atom-statistic.log

 

搜索最后一次出现string的地方

grep string file |tail -1