linux常用命令

2008年5月4日 | 15:00分类:linux | 标签: | 220 views

linux常用命令

列出/root目录下的的文件与相关的属性参数
[root@asterisk1 ~]# ls –al  /root   ←列出/root目录下所有文件
total 552
drwxr-x---   2 root root   4096 Mar 10 17:09 .
drwxr-xr-x  24 root root   4096 Mar 14 09:24 ..
-rw-r--r--   1 root root    799 Mar  9 21:12 anaconda-ks.cfg
-rw-------   1 root root    679 Mar 14 09:33 .asterisk_history
-rw-------   1 root root   3456 Mar 14 09:38 .bash_history
-rw-r--r--   1 root root     24 Feb 22  2005 .bash_logout
-rw-r--r--   1 root root    191 Feb 22  2005 .bash_profile
-rw-r--r--   1 root root    176 Feb 22  2005 .bashrc
-rw-r--r--   1 root root    100 Feb 22  2005 .cshrc
-rw-r--r--   1 root root 458035 Mar  9 21:20 install_asterisk.log
-rw-r--r--   1 root root  15014 Mar  9 21:12 install.log
-rw-r--r--   1 root root   3935 Mar  9 21:12 install.log.syslog
-rw-------   1 root root      0 Mar 10 17:09 .mysql_history
-rw-r--r--   1 root root    102 Feb 22  2005 .tcshrc
[root@asterisk1 ~]#
Date命令用法
[root@asterisk1 ~]# date
Fri Mar 14 11:03:33 HKT 2008'
[root@asterisk1 ~]# date +%Y/%m/%d
2008/03/14
[root@asterisk1 ~]# date +%H:%M
11:05
[root@asterisk1 ~]#
显示日历的命令
[root@asterisk1 ~]# cal
     March 2008
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
[root@asterisk1 ~]# cal 3 2008
     March 2008
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
[root@asterisk1 ~]# cal 2008
                               2008                                

       January               February                 March
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
       1  2  3  4  5                   1  2                      1
 6  7  8  9 10 11 12    3  4  5  6  7  8  9    2  3  4  5  6  7  8
13 14 15 16 17 18 19   10 11 12 13 14 15 16    9 10 11 12 13 14 15
20 21 22 23 24 25 26   17 18 19 20 21 22 23   16 17 18 19 20 21 22
27 28 29 30 31         24 25 26 27 28 29      23 24 25 26 27 28 29
                                              30 31
        April                   May                   June
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
       1  2  3  4  5                1  2  3    1  2  3  4  5  6  7
 6  7  8  9 10 11 12    4  5  6  7  8  9 10    8  9 10 11 12 13 14
13 14 15 16 17 18 19   11 12 13 14 15 16 17   15 16 17 18 19 20 21
20 21 22 23 24 25 26   18 19 20 21 22 23 24   22 23 24 25 26 27 28
27 28 29 30            25 26 27 28 29 30 31   29 30

        July                  August                September
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
       1  2  3  4  5                   1  2       1  2  3  4  5  6
 6  7  8  9 10 11 12    3  4  5  6  7  8  9    7  8  9 10 11 12 13
13 14 15 16 17 18 19   10 11 12 13 14 15 16   14 15 16 17 18 19 20
20 21 22 23 24 25 26   17 18 19 20 21 22 23   21 22 23 24 25 26 27
27 28 29 30 31         24 25 26 27 28 29 30   28 29 30
                       31
       October               November               December
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
          1  2  3  4                      1       1  2  3  4  5  6
 5  6  7  8  9 10 11    2  3  4  5  6  7  8    7  8  9 10 11 12 13
简单好用的计算器命令 bc
[root@asterisk1 ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1+2+3+4
10
7-8+3
2
10*52
520
10%3
1
10^2
100
10/100
0
scale=3
10/100
.100
quit
[root@asterisk1 ~]#
删除声卡模块
[root@test ~]# lsmod ←查看加载的模块
Module                  Size  Used by
ztdummy                 3924  0
wcfxo                  11424  0
zttranscode             9608  0
zaptel                192676  5 ztdummy,wcfxo,zttranscode
octvqe                 18864  1 zaptel
crc_ccitt               2113  1 zaptel
md5                     4033  1
ipv6                  235137  14
autofs4                24773  0
i2c_dev                11329  0
i2c_core               22081  1 i2c_dev
sunrpc                162725  1
dm_mirror              27825  0
dm_mod                 57557  1 dm_mirror
snd_ac97_codec         63889  0
snd_pcm_oss            49017  0
snd_mixer_oss          17985  1 snd_pcm_oss
snd_pcm                96841  1 snd_pcm_oss
snd_opl3_lib           11329  0
snd_timer              29893  2 snd_pcm,snd_opl3_lib
snd_hwdep               9925  1 snd_opl3_lib
snd_page_alloc          9673  1 snd_pcm
snd_mpu401_uart         8769  0
snd_rawmidi            26597  1 snd_mpu401_uart
snd_seq_device          8137  2 snd_opl3_lib,snd_rawmidi
snd                    55461  10 snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,
snd_opl3_lib,snd_timer,snd_hwdep,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore               9889  1 snd
e100                   41793  0
mii                     5185  1 e100
floppy                 58481  0
ext3                  116809  2
jbd                    71385  1 ext3
[root@test ~]# rmmod -f snd_ymfpci      ←强制删除声卡模块
[root@test ~]# cat /proc/interrupts     ←查看终端号
    CPU0
0:   21842745          XT-PIC  timer
1:          8          XT-PIC  i8042
2:          0          XT-PIC  cascade
8:          1          XT-PIC  rtc
11:     841866          XT-PIC  eth0
12:         66          XT-PIC  i8042
14:      32717          XT-PIC  ide0
15:        644          XT-PIC  ide1
NMI:          0
ERR:          0
[root@test ~]#  

[root@test rc.d]# vi /etc/rc.d/rc.local ←编辑开机删除模块

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/etc/trixbox/runonce
/usr/local/sbin/motd.sh > /etc/motd
/sbin/udevstart
/usr/sbin/ztcfg
/usr/sbin/fxotune -s
/usr/sbin/amportal start
rmmod -f snd_ymfpci  ←在文件最末增加此语句
显示文件内容命令:
  1. Cat 由第一行开始显示文件内容
  2. Tac 从最后一行开始显示,可以看出tac是cat的倒写
  3. More 一页一页地显示文件内容
  4. Less 与more类似,但其优点是,可以往前翻页
  5. Head 只看头几行
  6. Tail 只看末尾几行
  7. Nl 显示时同时输出行号
  8. Od 以二进制方式读取文件内容
[test ~]# cat -n .bash_history    ←查看最近的运行命令的历史记录
     1  ping www.15099.net
     2  ping www.lihaixin.com
     3  netconfig
     4  service network trstart
     5  service network restart
     6  ifconfig /all
     7  ifconfig
     8  init 0
     9  ifconfig
    10  ping mirror.freepbx.org
    11  ping www.xingke.net.cn
    12  cd /etc
    13  cd sysconfig/
    14  ls
    15  cd network-scripts/
    16  ls
    17  cat ifcfg-eth0
    18  init 0
    19  yum list installed
    20  yum search ftpd
    21  help-trixbox
    22  yum search ftpd
    23  yum
    24  yum -y install vsftpd
    25  ifconfig
    26  netconfig
    27  service network restart
    28  ifconfig
    29  yum
    30  uname -a
    31  cat /proc/version
    32  reboot
    33  uname -a
    34  cat /etc/issue
    35  uname -a
    36  cat /proc/cpuinfo
    37  cat /boot/grub/grub.conf
    38  cat /etc/sysconfig/zaptel
    39  lspci
    40  cat /proc/cpuinfo
    41  rpm -qa | grep zap
    42  cd /
    43  cd proc
    44  cat interrupts
    45  uname -a
    46  ifconfig
    47  ifconfig a
    48  ifconfig -a
    49  ifconfig
    50  ifconfig -a
    51  chkconfig --list cups
    52  ps -aux
    53  ifconfig
    54  ifconfig -a
    55  lsmod
    56  vi /etc/modprobe.conf
    57  cat /etc/modprobe.conf
    58  shutdown -r now
    59  lsmod
    60  hostname test
    61  exit

发表您的评论

您的名字: (*必填)

您的邮箱: (*不会被公布 ,必填)

您的网站: