馬哥教育網絡班20期第2周課程練習

答:

1、

cp,mv,rm,cat(tac,more,less,tail),touch

其中常用的有:

cp(復制):

                  -i:交互式

             -r, -R: 遞歸復制目錄及內部的所有內容;

[root@localhost tmp]# cp -r /var /tmp   

                  -a: 歸檔

[root@localhost etc]# cp -a system-release /tmp     

            –     v: –verbose 顯示詳細信息

                  -f: –force

rm:

            -i: 交互式

            -f: 強制刪除

            -r: 遞歸

      rm -rf:強制遞歸刪除

[root@totooco tmp]# rm -rf /tmp/mageedu/

cat:

                -E: 顯示行結束符$

                -n: 對顯示出的每一行進行編號

[root@localhost ~]# cat -n -E /etc/fstab

     1    $

     2    #$

     3    # /etc/fstab$

     4    # Created by anaconda on Tue May  3 07:14:15 2016$

     5    #$

     6    # Accessible filesystems, by reference, are maintained under '/dev/disk'$

     7    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info$

     8    #$

2、

命令執行狀態返回值:0為執行成功,1-255執行失敗

[root@totooco tmp]# ls

[root@totooco tmp]# echo $?

0

[root@totooco tmp]# lsss

bash: lsss: 未找到命令…

[root@totooco tmp]# echo $?

127

3、

(1)

[root@totooco tmp]# touch {a,b}_{c,d}

(2)

[root@totooco tmp]# mkdir -pv /tmp/mylinux/{bin,boot/grub,dev,etc/rc.d/init.d,sysconfig/network-scripts,lib/modules,lib64,proc,sbi

n,sys,tmp,usr/local/{bin,sbin},var/{lock,log,run}}

4、

元數據有size大小,blocks塊大小,修改時間訪問時間創建時間。

[root@localhost ~]# stat /etc

  File: "/etc"

  Size: 12288         Blocks: 24         IO Block: 4096   目錄

Device: 805h/2053d    Inode: 262146      Links: 102

Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)

Access: 2016-05-28 15:20:41.928339515 +0800

Modify: 2016-05-30 11:09:06.164941362 +0800

Change: 2016-05-30 11:09:06.164941362 +0800

5、

[root@localhost tmp]# alias lr='ls -l /root'

命令引用:name=$(command)

6、

[root@localhost /]# ls -d /var/l*[0-9]*[[:lower:]]

7、

[root@localhost /]# ls -d /etc/[0-9]*[^0-9]

8、

[root@localhost /]# ls -d /etc/[^[:alpha:]][[:alpha:]]*

9、

[root@totooco tmp]# name=`date +%y-%m-%d-%H-%M-%S`

[root@totooco tmp]# echo $name

16-06-14-18-30-00

[root@totooco tmp]# touch /tmp/tfile$name

10、

[root@localhost /]# cp -a /etc/p*[^0-9] /tmp/mytest1

11、

[root@localhost /]# cp -a /etc/*[.d] /tmp/mytest2

12、

[root@localhost /]# cp -a /etc/[lmn]*.conf  /tmp/mytest3

原創文章,作者:Net20_totooco,如若轉載,請注明出處:http://www.www58058.com/18591

(0)
Net20_totoocoNet20_totooco
上一篇 2016-06-23 10:56
下一篇 2016-06-23 10:56

相關推薦

  • Linux基礎知識

    命令的語法通用格式: # COMMAND OPTIONS ARGUMENTS COMMAND:  發起一命令:請求內核將某個二進制程序運行為一個進程; 程序 –> 進程 靜態 –> 動態(有生命周期) 命令本身是一個可執行的程序文件:二進制格式的文件,有可能會調用共享庫文件; 多數系統程序文件都存放在:/bin,…

    Linux干貨 2016-10-29
  • N25-第五周作業

    第五周作業 1、顯示當前系統上root、fedora或user1用戶的默認shell; grep "^\(root|fedora|user1\)" /etc/passwd | cut -d: -f7 2、找出/etc/rc.d/init.d/functions文件中某單詞后面跟一組小括號的行,形如:hello(); grep "…

    Linux干貨 2017-02-14
  • 不作死就不會死,運維的危險命令(2)

    命令是一種很有趣且有用的東西,但在你不知道會帶來什么后果的時候,它又會顯得非常危險。所以,在輸入某些命令前,請多多檢查再敲回車。

    2017-12-03
  • 配置Nginx作為反向代理服務器

    配置Nginx作為反向代理服務器      一、nginx作為反向代理的工作模型: 1、nginx作為反向代理的工作模型       nginx工作在應用層,其能理解并可以提取出http請求報文中的首部信息中的請求方法、url、http協議版本等信息。   &…

    Linux干貨 2016-10-29
  • 走入系統命令

    一、inode節點號         在linux中,每一個文件都有唯一的inode號,inode號也是系統識別的唯一編碼,而文件名僅僅是為了使用者區分辨認, inode (index node )表中包含文件系統所有文件列表 一個節點(索引節點)是在一個表項,包含有關…

    2017-05-25
  • Linux 第三天: (07月26日) Linux使用幫助

    Linux 第三天: (07月26日) Linux使用幫助         whatis 顯示命令的簡短描述makewhatis centos6 制作數據庫mandb centos7 制作數據庫 help COMMAND 內部命令man bash 內部命令COMMAND –help -h 外部命令man C…

    Linux干貨 2016-08-08

評論列表(1條)

  • 馬哥教育
    馬哥教育 2016-06-23 13:52

    寫的很棒,可以把題目也寫上,那樣會更加的美觀一些,在看看第10題

欧美性久久久久