Linux命令行

Linux命令行

  1. [root@linux root]# who
    root tty1 Oct 16 16:18
    use1 pts/0 Oct 16 16:49 (192.168.1.1)
  2. [root@linux root]# who
    root tty1 Oct 16 16:18
    use1 pts/0 Oct 16 16:49 (192.168.1.1)
    3.[root@linux root]# date
    三 10月 16 17:03:55 CST 2019
    4.[root@linux root]# cal
    十月 2019
    日 一 二 三 四 五 六
    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. [root@linux root]# passwd
    Changing password for user root.
    New password:
    BAD PASSWORD: it is too simplistic/systematic
    Retype new password:
    passwd: all authentication tokens updated successfully.
    6.[root@linux root]# cat >file1
    this is a book
    this is a pencil
    this is a pencilbox
    [root@linux root] # cat file1
    this is a book
    this is a pencil
    this is a pencilbox
    [root@linux root]# cat file1 > file2
    this is a book
    this is a pencil
    this is a pencilbox
    [root@linux root]#
  4. [root@linux root]# more /etc/termcap
    ######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE

This version of terminfo.src is distributed with ncurses.
Report bugs to
bug-ncurses@gnu.org

   Version 10.2.1
  $Date: 2001/05/19 20:56:45 $
  terminfo syntax

 Eric S. Raymond         (current maintainer)
 John Kunze, Berkeley
Craig Leres, Berkeley

#Please e-mail changes to terminfo@thyrsus.com; the old termcap@berkeley.edu
[root@linux root]# more file1
this is a book
this is a pencil
this is a pencilbox
[root@linux root]#
8. [root@linux root]# head -5 /etc/termcap
######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE

#This version of terminfo.src is distributed with ncurses.
Report bugs to
bug-ncurses@gnu.org
9. [root@linux root]# tail -c 10 /etc/termcap
SHANTIH!
10. [root@linux root]# find -name file1
./file1
[root@linux root]# find -name file2 -exec cat {} ;
you are a boy
you are a girl
[root@linux root]# find -name file2 -ok {} ;
< {} … ./file2 > ? n
[root@linux root]# find -name file2 -exec cp {} file1 ;
[root@linux root]# find -name file1 -exec cat {} ;
you are a boy
you are a girl
11. [root@linux root]# cat file1
you are a boy
you are a girl
[root@linux root]# cat file2
you are a boy
you are a girl
[root@linux root]# comm -12 file1 file2
you are a boy
you are a girl
12. [root@linux root]# grep you file1
you are a boy
you are a girl
13.[root@linux root]# diff -i file1 file2
[root@linux root]# diff -i file1 file3
1,2c1,2
< you are a boy
< you are a girl

they are friend
these are apple

  1. [root@linux root]# $ cp file1 file3
    -bash: $: command not found
    [root@linux root]# cp file1 file3
    cp:是否覆盖‘file3’? n
  2. [root@linux root]# rm -i file1
    rm:是否删除一般文件‘file1’? n
    [root@linux root]# rm -i file1
    rm:是否删除一般文件‘file1’? y
    [root@linux root]# cat file1
    cat: file1: 没有那个文件或目录
  3. [root@linux root]# mv file2 file4
    [root@linux root]# cat file4
    you are a boy
    you are a girl
  4. [root@linux root]# wc -lcw file3 fil4
    2 6 33 file3
    wc: fil4: 没有那个文件或目录
    2 6 33 总用量
    [root@linux root]# wc file3 file4
    2 6 33 file3
    2 8 30 file4
    4 14 63 总用量
  5. [root@linux root]# mkdir aa
    [root@linux root]# mkdir ./aa/bb
    [root@linux root]# ls
    aa fil1 file3 install.log
    anaconda-ks.cfg fil2 file4 install.log.syslog
    19.[root@linux root]# rmdir -p aa/bb
    [root@linux root]# ls
    anaconda-ks.cfg fil2 file4 install.log.syslog
    fil1 file3 install.log
  6. [root@linux root]# cd ./aa/bb
    [root@linux bb]# cd …
    [root@linux aa]# cd …
  7. [root@linux root]# pwd
    /root
    22.[root@linux root]# ls -i
    908205 aa 293035 fil2 291458 install.log
    293024 anaconda-ks.cfg 293038 file3 291459 install.log.syslog
    293033 fil1 293037 file4
    [root@linux root]# ls -l
    总用量 48
    drwxr-xr-x 3 root root 4096 10月 16 17:54 aa
    -rw-r–r-- 1 root root 1310 2018-09-05 anaconda-ks.cfg
    -rw-r–r-- 1 root root 38 9月 11 18:18 fil1
    -rw-r–r-- 1 root root 36 9月 11 18:18 fil2
    -rw-r–r-- 1 root root 33 10月 16 17:26 file3
    -rw-r–r-- 1 root root 30 10月 16 17:24 file4
    -rw-r–r-- 1 root root 17528 2018-09-05 install.log
    -rw-r–r-- 1 root root 3958 2018-09-05 install.log.syslog
  8. [root@linux root]# mkdir ./cc/dd
    [root@linux root]# ln ./aa/bb ./cc/dd
    ln: ‘./aa/bb’: 不允许将硬链接连至目录
  9. [root@linux root]# ls
    aa cc fil2 file4 install.log.syslog
    anaconda-ks.cfg fil1 file3 install.log
  10. [root@linux root]# man date
    DATE(1) User Commands DATE(1)

NAME
date - print or set the system date and time

SYNOPSIS
date [OPTION]… [+FORMAT]
date [-u|–utc|–universal] [MMDDhhmm[[CC]YY][.ss]]

DESCRIPTION
Display the current time in the given FORMAT, or set the system date.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值