中文字幕在线一区二区在线,久久久精品免费观看国产,无码日日模日日碰夜夜爽,天堂av在线最新版在线,日韩美精品无码一本二本三本,麻豆精品三级国产国语,精品无码AⅤ片,国产区在线观看视频

      Linux常用命令行

      時間:2024-09-11 06:32:41 Linux認證 我要投稿
      • 相關推薦

      Linux常用命令行匯總

        Linux常用命令有哪些?下面yjbys小編特為正在學習Linux的同學們分享十五個常用Linux命令行,歡迎閱讀!

        1. 磁盤使用情況

        du -h 查看當前用戶每個文件的大小,格式化顯示

        df -h 磁盤使用情況

        [root@localhost mysql5]# du -h

        339M

        [root@localhost mysql5]# ls

        MySQL-5.5.20-1.linux2.6.i386.tar

        MySQL-client-5.5.20-1.linux2.6.i386.rpm

        MySQL-devel-5.5.20-1.linux2.6.i386.rpm

        MySQL-embedded-5.5.20-1.linux2.6.i386.rpm

        MySQL-server-5.5.20-1.linux2.6.i386.rpm

        MySQL-shared-5.5.20-1.linux2.6.i386.rpm

        MySQL-test-5.5.20-1.linux2.6.i386.rpm

        [root@localhost mysql5]# du -h MySQL-client-5.5.20-1.linux2.6.i386.rpm

        17M MySQL-client-5.5.20-1.linux2.6.i386.rpm

        [root@localhost mysql5]#

        [root@localhost mysql5]# df -h

        文件系統 容量 已用 可用 已用% 掛載點

        /dev/mapper/VolGroup00-LogVol00

        14G 6.4G 6.5G 50% /

        /dev/sda1 99M 12M 83M 13% /boot

        tmpfs 506M 0 506M 0% /dev/shm

        2、常用文件操作命令

        cat,顯示文件內容。

        cd,改變目錄路徑。

        cp,復制文件。

        find,查找文件。

        grep,搜索、過濾信息。

        ls,列出目錄信息。

        more,分頁顯示。

        rm,刪除文件或目錄。

        vi,調用vi文本編輯器

        [root@localhost king]# cat abc1.txt |more

        //查找當前目錄下以a開頭的文件

        [root@localhost king]# ls

        abc1.txt abc2.txt abc3.txt king001 kingtest new

        [root@localhost king]# find -name "a*"

        ./abc3.txt

        ./abc1.txt

        ./abc2.txt

        [root@localhost home]# find king -name "a*"

        king/abc3.txt

        king/abc1.txt

        king/abc2.txt

        grep查找keyword的所在行的內容

        [root@localhost king]# more abc1.txt|grep "1971"

        Federal Election Campaign Act of 1971 to provide bipartisan campaign

        ls統計文件個數:原理是ls -l列出多少行 再利用管道作為wc -l輸入 以行來數的

        [root@localhost king]# ls -l

        總計 44

        -rwxrw-rw- 1 root root 2395 2012-05-26 abc1.txt

        -rwxrw-rw- 1 root root 2397 2012-05-26 abc2.txt

        -rwxrw-rw- 1 root root 1020 2012-05-26 abc3.txt

        drwxrwxr-x 2 king king 4096 2012-02-02 king001

        -rw-rw-r-- 1 king king 0 2012-02-02 kingtest

        -rw-r--r-- 1 root root 714 09-30 22:52 new

        [root@localhost king]# ls -l|wc -l

        7

        head 查看文件前20行 tail 查看后面10行

        [root@localhost king]# head -20 abc1.txt

        [Congressional Record Volume 148, Number 2 (Thursday, January 24, 2002)]

        [Daily Digest]

        [Page D12]

        From the Congressional Record Online through the Government Printing Office [www.gpo.gov]

        House of Representatives

        Chamber Action

        Measures Introduced: 13 public bills, H.R. 3622-3634; 8 resolutions, H.

        Con. Res. 302-308, and H. Res. 335 were introduced.

        Page H78

        Reports Filed: No reports were filed today.

        Speaker Pro Tempore: Read a letter from the Speaker wherein he

        appointed Representative Shimkus to act as Speaker pro tempore for

        today.

        [root@localhost king]# tail -10 abc1.txt

        Res. 203, providing for consideration of H.R. 2356, to amend the

        Federal Election Campaign Act of 1971 to provide bipartisan campaign

        reform, the motion was referred to the Calendar of Motions to Discharge

        Committees.

        Pages H76-77

        Senate Message: Message received from the Senate appears on page H39.

        Quorum Calls--Votes: One yea-and-nay vote developed during the

        proceedings of the House today and appears on pages H47-48. There were

        no quorum calls.

        Adjournment: The House met at 10 a.m. and adjourned at 3:38 p.m.

        Linux命令經典面試題:統計文件中出現次數最多的前10個單詞

        使用linux命令或者shell實現:文件words存放英文單詞,格式為每行一個英文單詞(單詞可以重復),統計這個文件中出現次數最多的前10個單詞。

        cat words.txt | sort | uniq -c | sort -k1,1nr | head -10

        主要考察對sort、uniq命令的使用,相關解釋如下,命令及參數的詳細說明請自行通過man查看,簡單介紹下以上指令各部分的功能:

        sort: 對單詞進行排序

        uniq -c: 顯示唯一的行,并在每行行首加上本行在文件中出現的次數

        sort -k1,1nr: 按照第一個字段,數值排序,且為逆序

        head -10: 取前10行數據

        [root@localhost king]# uniq -c word.txt|sort -k1

        1 bye

        1 good

        1 see

        1 tim

        1 tim

        1 you

        2 jack

        2 king

        [root@localhost king]# uniq -c word.txt|sort -r|head -2

        2 king

        2 jack

      【Linux常用命令行】相關文章:

      Linux中常用操作命令03-06

      常用的Linux網絡工具03-29

      Linux常用命令匯總03-10

      Linux常用基本命令精選201601-22

      Linux入門常用命令03-29

      Linux常用網絡狀態測試命令03-05

      java jar 命令行參數03-04

      Linux shell常用命令匯總03-30

      java命令行參數解析201603-30

      主站蜘蛛池模板: 久久精品国产亚洲AV高清y w| 亚洲女同专区在线九九| 精品午夜一区二区三区| 国产精品原创永久在线观看| 九月色婷婷免费| 欧美精品一本久久男人的天堂| 枞阳县| 国产桃色精品网站| 亚洲精品自拍视频在线观看| 成人av在线日韩一区| 日本一区二区在线资源| 揄拍成人国产精品视频肥熟女| 老河口市| 张家界市| 关岭| 永善县| 区。| 黑水县| 国产精品久久中文字幕第一页 | 无码国产一区二区色欲| 亚洲精品二区在线观看| 97人妻蜜臀中文字幕| 西城区| 大石桥市| 日韩美女高潮流白浆视频在线观看| 日本熟妇hd8ex视频| 日韩精品永久免费播放平台| 精品久久杨幂国产杨幂| 蜜桃成人午夜激情网站| 国产成年无码aⅴ片在线观看| 精品在免费线中文字幕久久| 中国国内新视频在线不卡免费看| 崇明县| 国产又粗又猛又黄色呦呦| 中文字幕亚洲好看有码| av在线亚洲国产精品| 亚洲高清视频在线播放| 国产成人亚洲欧美三区综合| 国产成本人视频在线观看| 亚洲精品永久一区二区三区| 激情五月天俺也去综合网|