linux基础命令
1.shutdown
   常用命令:
     (1)  shutdown -h 1      --一分钟关机
     (2)  shutdown -h now    --现在关机
     (3)  shutdown -h 15:30  --定在某一个时间关机
  细节:  shutdown -r 2        --系统在两分钟启动  
2.poweroff命令:
     poweroff    ---立即关闭电源
3. halt          --- 挂起系统 
4. reboot    ------重新启动系统
5.***---  init命令  ----***
    init [0-停机,1-单用户模式,2-多用户模式]
         [3-完全多用户模式,4-未分配使用,5-图形界面,6-重新启动]
    当我们忘掉了root命令时,将系统切换至单用户模式,
然后重新设置root用户密码。
6. 查找一个我们安装好的软件。
    rpm -aq | grep gcc  --查询我们是否已经安装好了gcc软件
    rpm -aq    --列出所有已经安装好的软件
   加上一个通道,来进一步约束查询条件。
7.  对于一个小问题:
   如何将一个内容,编辑到文件中保存。
    比如  netstate -an >>Gxjun.txt  使用 >> 为追加而使用 > 为覆盖
   
8.  对于< 和 << 这两种操作,也是存在与同上差不多的区别、
9. cd的用法:
    (1) :  cd /home    ---绝对路径
    (2) :   cd ../etc   ---相对路径
   
10: ~ 表示当前用户的家目录,因此
    [root@tomato2 etc]# cd ~    --回到家目录
11.  ls   --查看文件列表命令
    pwd   查看当前所在目录 
12. touch  创建一个空文件
     touch [option/路径] filename
     touch Gxjun   --创建一个名为Gxjun的文件。
-----------------------修改时间戳-----------------------------
     sh-4.1# touch -d "10/12/10 21:20" gxjun
     sh-4.1# ls -l gxjun
     -rw-r--r--. 1 root root 0 Oct 12  2010 gxjun
13. mkdir ---创建一个目录
14. mv  res  dec   ---移动一个文件
15. 查看文件类型  file  filename 
         sh-4.1# file gxjun   
          gxjun: empty
16:  当我们想看一个文件的内容时,一般有两种方法。
     方法一:   vi  gxijun.txt  运用vi打开,然后查看。
     方法二:   cat gxjun.txt 直接显示在黑白面板上。
17. tail命令的作用在于从文本最后一行开始查看文本。
    
[root@tomato2 ~]# tail -2  Gxjun.txt   ---查看Gxjun.txt最后两行的内容
unix  3      [ ]         DGRAM                    9115
unix  3      [ ]         DGRAM                    9114
18. more 命令 经常习惯性的用于查看长文件。
  [root@tomato2 ~]# more Gxjun.txt
 与此同时: less 
19. wc  --文本统计命令【行数,词数,字节数,及文件名】
20. 关于时间的一些基本命令
  (1).[root@tomato2 ~]# date +"%F  %T"
      2015-03-15  10:49:09
  (2).[root@tomato2 ~]# cal
        March 2015
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
 (3).
   注意: cal命令查看指定的年月 比如查看2009年2月的日历
     [root@tomato2 ~]# cal 2 2009
    February 2009
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
21.需要注意的是:  
  Linux有两个时钟,第一个时钟为系统自带的系统。第二种为硬件系统。
22.who ---查看当前系统中的用户
    [root@tomato2 ~]# who
      root     tty1         2015-03-06 09:25
      root     pts/0        2015-03-15 10:26 (192.168.0.112)
23. finger --命令查看登录到系统的用户及相关信息、
24. w ---查看正在使用系统的用户。
    [root@tomato2 ~]# w
 10:59:19 up 9 days, 34 min,  2 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1     -                06Mar15 12:57m  0.13s  0.03s bash
root     pts/0    192.168.0.112    10:26    0.00s  0.24s  0.04s w
25. wall ---向所有在线的用户发送公告。
 
[root@tomato2 ~]# wall hello world!!
wall hello worldclear
Broadcast message from root@tomato2 (pts/0) (Sun Mar 15 11:02:09 2015):
hello worldclear
26. write   ---向其他用户【包括root】发送消息。   【Ctrl+C  ---退出即使消息模式】
27. mesg [n/y] ---该命令为拒绝接受消息或者接受消息。
28. fuser  --断开联系用户命令fuser


 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号