---
title: "记录一些Linux命令"
author: "sole"
date: "2010-07-30T14:24:50Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2010-07-30T14:24:50Z"
id: 725356
url: "https://hex.iteye.com/blog/725356"
---

time \[option] command \[argments] 或 /usr/bin/time

计算程序运行时间

 

wc \[option] filename 计算文件字数,行数等等

 

find \[path] -name "\*name\*"

查找文件

 

chown -R user file

改变文件拥有者. -R包含所有子目录

 

chmode -R xxx  file

xxx表示user, group, other的运行,读,写

ug+w, 表示本用户和同组用户有写权限.

 

cd - 后退到上次目录

 

scp localpath  remotepath   or scp remotepath localpath

利用ssh文件传输

 

/etc/resolv.conf

nameserver 192.168.0.1

nameserver ....

本机DNS server设置

 

tar -zxvf name.tar -C path

解压name.tar到path下

 

符号连接(或叫软连接):  删除原始文件后, 不能再引用, 跨fs.   ln -s 源文件名 软连接文件名

硬连接:  删除原始文件后, 还能继续引用. 引用计数. 不能跨fs   ln -d 源文件名 硬连接文件名