易截截图软件、单文件、免安装、纯绿色、仅160KB

[基础]常用linux命令 备查

=================文件操作==================
不使用find直接使用通配符对文件操作:
cp ./*/*attch* /testout_attch/
 
文件内容显示
head/tail:
  ## (1) displays the first 6 lines of a file
  head -6 readme.txt
  ## (2) displays the last 25 lines of a file
  tail -25 mail.txt
  ## (3) display the file from 11 to 20 
  head -20 file | tail -10
tail -f 刷新显示
 
 
==================安装卸载================== 
rmp相关:
查看是否安装 rpm -qa | grep
是否安装 rpm -e (–nodeps) 软件包
 
 
 
 
===================运行===================
查看历史:
history|less
(export HISTTIMEFORMAT='%F %T '增加环境变量显示时间)
!N 运行第N条指令。
 
 
===================磁盘===================
 
文件文件夹大小:
du --max-depth=N -h(--human-readable)
du -a(all)b(bytes) = ll
 
磁盘空间:
fdisk -l = fdisk /dev/sda1 ->p
df
 
 
===================进程===================
查看进程:
ps -ef|grep httpd|wc -l
ps -auxf
 
 
===================网络=================== 
查看端口:
netstat -an|grep -i "80"|wc -l
 
查看dns包括ns记录,a记录,mx记录
查找yahoo.com的a记录:
      dig yahoo.com a +noall +answer
      查找yahoo.com mx记录的列表:
      dig yahoo.com mx +noall +answer
      查找yahoo.com的权威dns:
      dig yahoo.com ns +noall +answer
      查询上面所有的记录:
      dig yahoo.com any +noall +answer
 
 
===================查询===================
find -anewer
    (touch -d xx)
find -exec commond "{}"
 (find .-name '*.zip' -exec unzip "{}"\;)
 
 
===================压缩====================
tar命令:
-c:压缩
      -x:解压
      -t:查看内


相关文档:

Linux 清楚回收站

在root模式下: # #delete files in trash # #date:2010-3-5 # #maker:tootwo # dir=/root/.Trash [ -d $dir ] x=$? y=0 if test $x -eq $y      then         (for i in $dir/*             do  &nbs ......

在Linux上找出并解决程序错误的主要方法

来源:http://www.y768.com/content/view/5755/109/
Steve Best(sbest@us.ibm.com)
JFS 核心小组成员,IBM
2002 年 8 月
您可以用各种方法来监控运行着的用户空间程序:可以为其运行调试器并单步调试该程序,添加打印语句,或者添加工具来分析程序。本文描述了几种可以用来调试在 Linux 上运行的程序的方法。我们将回 ......

在Linux操作系统下修改IP、DNS和路由配置

ifconfig eth0 新IP
然后编辑/etc/sysconfig/network-scrIPts/ifcfg- eth0,修改IP
一、修改IP地址
[aeolus@db1 network-scrIPts]$ vi ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=219.136.241.211
NETMASK=255.255.255.128
GATEWAY=219.136.241.254
二、修改网关
vi /etc/sysconfig/network
N ......

Linux socket编程

什么是Socket  
    Socket接口是TCP/IP网络的API,Socket接口定义了许多函数或例程,程序员可以用它们来开发TCP/IP网络上的应用程序。要学Internet上的TCP/IP网络编程,必须理解Socket接口。
 
 Socket接口设计者最先是将接口放在Unix操作系统里面的。如果了解Unix系统的输入和输出的话,就很容易了 ......

Linux的tail命令

tail命令用途
从指定点开始将文件写到标准输出。使用tail命令的-f选项可以方便的查阅正在改变的日志文件,tail -f
filename会把filename里最尾部的内容显示在屏幕上,并且不但刷新,使你看到最新的文件内容。
语法
标准语法
tail [ -f ] [ -c Number | -n Number | -m Number | -b
Number | -k Number ] [ File ] ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号