色偷偷偷久久伊人大杳蕉,色爽交视频免费观看,欧美扒开腿做爽爽爽a片,欧美孕交alscan巨交xxx,日日碰狠狠躁久久躁蜜桃

x
x
樓主: changyongid
打印 上一主題 下一主題

一天一個Linux命令

[復(fù)制鏈接]
41
發(fā)表于 2009-9-4 17:20:08 | 只看該作者
加精是應(yīng)該的。
快速插入一樓。
42
 樓主| 發(fā)表于 2009-9-4 17:32:37 | 只看該作者
本帖最后由 changyongid 于 2009-9-4 17:57 編輯

我們還是先來help一下,因為看幫助文檔是一個非常好的習(xí)慣。

[changyongid@localhost src]$ od --help
Usage: od [OPTION]... [FILE]...
  or:  od [-abcdfilosx]... [FILE] [[+]OFFSET[.]]
  or:  od --traditional [OPTION]... [FILE] [[+]OFFSET[.] [+][LABEL][.]]

Write an unambiguous representation, octal bytes by default,
of FILE to standard output.  With more than one FILE argument,
concatenate them in the listed order to form the input.
With no FILE, or when FILE is -, read standard input.

All arguments to long options are mandatory for short options.
  -A, --address-radix=RADIX   decide how file offsets are printed 指定地址基數(shù),這里的RADIX在help下面有詳細(xì)的解釋。
  -j, --skip-bytes=BYTES      skip BYTES input bytes first
  -N, --read-bytes=BYTES      limit dump to BYTES input bytes
  -S, --strings[=BYTES]       output strings of at least BYTES graphic chars
  -t, --format=TYPE           select output format or formats 數(shù)據(jù)顯示格式 ,同樣的,TYPE在help的下面也有詳細(xì)的解釋。
  -v, --output-duplicates     do not use * to mark line suppression
  -w, --width[=BYTES]         output BYTES bytes per output line
      --traditional           accept arguments in traditional form
      --help     顯示此幫助信息并退出
      --version  輸出版本信息并退出

我們比較常用的就是-A 和 -t參數(shù)了。。
RADIX的說明如下:

RADIX is d for decimal, o for octal, x for hexadecimal or n for none.

即:
d -十進(jìn)制
o -八進(jìn)制
x -十六進(jìn)制
n -不打印偏移植

TYPE的說明如下:
TYPE is made up of one or more of these specifications:

  a          named character, ignoring high-order bit
  c          ASCII character or backslash escape ASCII字符或反斜杠序列
  d[SIZE]    signed decimal, SIZE bytes per integer有符號十進(jìn)制數(shù)
  f[SIZE]    floating point, SIZE bytes per integer浮點數(shù)
  o[SIZE]    octal, SIZE bytes per integer八進(jìn)制(系統(tǒng)默認(rèn)值為02)
  u[SIZE]    unsigned decimal, SIZE bytes per integer無符號十進(jìn)制數(shù)
  x[SIZE]    hexadecimal, SIZE bytes per integerx 十六進(jìn)制數(shù)

除了選項c以外的其他選項后面都可以跟一個十進(jìn)制數(shù)n,指定每個顯示值所包含的字節(jié)數(shù)。

說明:od命令系統(tǒng)默認(rèn)的顯示方式是八進(jìn)制,這也是該命令的名稱由來(Octal Dump)。但這不是最有用的顯示方式,用ASCII碼和十六進(jìn)制組合的方式能提供更有價值的信息輸出。
43
 樓主| 發(fā)表于 2009-9-4 17:59:29 | 只看該作者
來個列子,其中mmu為我編譯一個程序后生成的可執(zhí)行文件。輸出太多,我沒有貼全。
[changyongid@localhost mmu]$ od -Ax mmu
000000 000007 165000 177776 165377 177776 165377 177776 165377
000010 177776 165377 177776 165377 170000 162637 177776 165377
000020 040160 030000 155001 161640 000033 165400 000041 165400
000030 000141 165400 000351 165400 000361 165400 150100 162637
000040 170100 162637 000542 165400 000626 165400 170322 161441
000050 152063 161640 170337 161441 150044 162637 000361 165400
000060 170137 161441 160040 162637 170040 162637 177776 165377
000070 160004 161116 057777 164455 160024 162637 170024 162637
000080 117777 164375 000000 030020 040104 030000 040154 030000
000090 044054 030000 040200 030000 043440 030000 140015 160640
0000a0 154000 164455 130004 161114 022123 161640 030000 161640
44
 樓主| 發(fā)表于 2009-9-4 18:11:23 | 只看該作者
這個od命令,平時沒怎么用過,確實不知道有什么實用的地方。
45
發(fā)表于 2009-9-5 17:37:52 | 只看該作者
期待今天的更新。
46
 樓主| 發(fā)表于 2009-9-5 21:06:26 | 只看該作者
嘿嘿。今 天周末。。本來想給大家放天假。。。

恰 今天有個文檔要編輯整理下。。。

不過,還是繼續(xù)的好。。說好一天一個的。。。呆會更新。。。謝謝支持。
47
 樓主| 發(fā)表于 2009-9-7 08:24:39 | 只看該作者
周末停了兩天。  宿舍里不是很方便。。。。
48
 樓主| 發(fā)表于 2009-9-7 08:27:40 | 只看該作者
前面我們學(xué)習(xí)了幾個查看文件內(nèi)容的命令。會用這幾個命令,查看一般的文件內(nèi)容也就夠用了。。。
那么,接下來學(xué)習(xí)一個命令,用于文件內(nèi)容的統(tǒng)計。。。
49
 樓主| 發(fā)表于 2009-9-7 08:36:00 | 只看該作者
這個命令就是 wc  我們先來help一下。
[changyongid@localhost ~]$ wc --help
用法:wc [選項]... [文件]...
  或:wc [選項]... --files0-from=F
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified.  With no FILE, or when FILE is -,打印文件的行、字、字節(jié)數(shù)
read standard input. 沒有指定文件時,則從標(biāo)準(zhǔn)輸入讀取
  -c, --bytes            print the byte counts字節(jié)數(shù)
  -m, --chars            print the character counts 這個好像也是字節(jié)數(shù)
  -l, --lines            print the newline counts行數(shù)
      --files0-from=F    read input from the files specified by
                           NUL-terminated names in file F;
                           If F is - then read names from standard input
  -L, --max-line-length  print the length of the longest line 最長行的長度
  -w, --words            print the word counts字?jǐn)?shù)
      --help     顯示此幫助信息并退出
      --version  輸出版本信息并退出
50
 樓主| 發(fā)表于 2009-9-7 08:48:07 | 只看該作者
現(xiàn)在來試一下這個命令。。。有名為 tt 的一個文件。。我們來對其操作一下。。

[changyongid@localhost ~]$ cat tt                        //這里是tt的內(nèi)容
ok let is abc def g
abc efg
asdfghjkldafsdfa
[changyongid@localhost ~]$ wc -c tt              //字節(jié)數(shù)
45 tt
[changyongid@localhost ~]$ wc -m tt             //這個跟字節(jié)數(shù)相同,不敢確定
45 tt
[changyongid@localhost ~]$ wc -l tt              //行數(shù)
3 tt
[changyongid@localhost ~]$ wc -L tt               //最長行的字符數(shù)
19 tt
[changyongid@localhost ~]$ wc -w tt            //字?jǐn)?shù),以空格分開的
9 tt
51
 樓主| 發(fā)表于 2009-9-8 19:06:40 | 只看該作者
前面所學(xué)的命令都是針對文件的。!,F(xiàn)在開始來學(xué)習(xí)針對目錄的命令吧。。。
cd   這個命令很簡單,也很基本。。也最常用。
52
 樓主| 發(fā)表于 2009-9-8 19:07:29 | 只看該作者
首先,我們來help一下。。
[changyongid@localhost vivi]$ cd --help
bash: cd: --: invalid option
cd: usage: cd [-L|-P] [dir]

可以看到,這個命令的參數(shù)非常的簡單。
53
 樓主| 發(fā)表于 2009-9-8 21:45:59 | 只看該作者
繼續(xù)來看。 help得到的信息很少,那么就man一下。。 截取一些有用的信息。
Change  the  current directory to dir.  The variable HOME is the
              default dir.  
The  -P  option  says  to use the physical directory structure instead of
              following symbolic links (see also the  -P  option  to  the  set
              builtin command); the -L option forces symbolic links to be fol-
              lowed.  An argument of - is equivalent to $OLDPWD.   

英語不好,大意是 改變當(dāng)前目錄到參數(shù)dir這個目錄里。HOME是進(jìn)入終端時的默認(rèn)目錄。
至于-P 和-L命令我也沒搞大清楚。大概跟鏈接link有關(guān)

還有一個比較有用的就是  - 參數(shù)。。它代表上一個進(jìn)入的目錄。。
比如:
[changyongid@Fedora ~]$ pwd
/home/changyongid
可以看到,當(dāng)前目錄是這個用戶的主目錄。。。
[changyongid@Fedora ~]$ cd /
[changyongid@Fedora /]$ pwd
/
這樣之后,又到了根目錄里。。。
那么:
[changyongid@Fedora /]$ cd -
/home/changyongid
[changyongid@Fedora ~]$ pwd
/home/changyongid
這樣,看到,又回到上一次進(jìn)入的目錄。。。。

這個參數(shù)感覺非常的有用。。用起來很方便。。。當(dāng)然,這里具的例子可能不恰當(dāng),因為路徑很少,當(dāng)路徑很長時它的作用就明顯了。

直接cd 不帶參數(shù),則會進(jìn)入當(dāng)前用戶主目錄。
54
 樓主| 發(fā)表于 2009-9-8 21:48:53 | 只看該作者
另外還有兩個小技巧。
cd !$          #把上個命令的參數(shù)作為輸入。
cd ~         #同樣也是回到主目錄

其實,這都是跟環(huán)境變量很有關(guān)系。
先了解這么多,今天有些累。。。散會。
55
 樓主| 發(fā)表于 2009-9-8 21:50:05 | 只看該作者
另外還有兩個小技巧。
cd !$          #把上個命令的參數(shù)作為輸入。
cd ~         #同樣也是回到主目錄

其實,這都是跟環(huán)境變量很有關(guān)系。
先了解這么多,今天有些累。。。散會。
56
 樓主| 發(fā)表于 2009-9-9 08:29:45 | 只看該作者
又是一天的開始,我們繼續(xù)努力。
57
 樓主| 發(fā)表于 2009-9-9 08:32:54 | 只看該作者
本帖最后由 changyongid 于 2009-9-9 08:36 編輯

學(xué)習(xí)cd命令的時候,看到我打的pwd命令了吧。。。。那么這個命令是干什么的呢?相信你肯定已經(jīng)知道了。沒錯。我們來man一下
PWD(1)                           User Commands                          PWD(1)

NAME
       pwd - print name of current/working directory  

SYNOPSIS
       pwd [OPTION]...

DESCRIPTION
       Print the full filename of the current working directory.
打印當(dāng)前工作目錄的絕對路徑

       -L, --logical
              use PWD from environment, even if it contains symlinks

       -P, --physical
              avoid all symlinks

       --help display this help and exit

       --version
              output version information and exit

至于-P -L的選項,我還不知道是什么意思。。

58
 樓主| 發(fā)表于 2009-9-9 08:46:03 | 只看該作者
今天這個命令挺簡單的。好像偷懶了。。
那么來規(guī)劃一下未來幾天要學(xué)習(xí)的命令吧。。。
mkdir  創(chuàng)建目錄
rmdir   刪除目錄
ls   列出一個目錄中的文件
cp  復(fù)制
mv 移動
rm 刪除
一看就知道這些命令在我們的日常使用中的頻率有多么高。所以好好的掌握是非常有必要的。
59
 樓主| 發(fā)表于 2009-9-10 15:45:12 | 只看該作者
有時候就是這樣,腦子一下子僵在那里……突然想不動事情。

于是,再來學(xué)習(xí)一個命令。。。。

話又說回來。這些命令,如果不經(jīng)常的去敲打的話,學(xué)到后面,很容易就忘了前面,特別是那些參數(shù),忘起來就更快了。所以,還是有必要定時回過頭去翻翻前面的貼子。

這樣的話,就定個定時器,中斷觸發(fā),專門的處理函數(shù)去響應(yīng)。。。。

學(xué)習(xí)就是這個道理,給自己定個定時器,采用中斷觸發(fā),定時回過頭來復(fù)習(xí)已學(xué)過的內(nèi)容。這樣我們的大腦這臺cpu才能跑的更好。。。
如查采取循環(huán)的模式,一個循環(huán)回來響應(yīng)一次這個“復(fù)習(xí)”處理函數(shù),那可就時間長了。說不定我們的cpu一直跑下去了,再也不回頭了。。。這就是人的特殊性,因為這個程序往往是不循環(huán)的……
60
 樓主| 發(fā)表于 2009-9-10 15:50:06 | 只看該作者
ok 。。。mkdir。

[changyongid@localhost ~]$ mkdir --help
用法:mkdir [選項]... 目錄...
若目錄不是已經(jīng)存在則創(chuàng)建目錄。

長選項必須用的參數(shù)在使用短選項時也是必需的。
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask 對新建目錄設(shè)置存取權(quán)限
  -p, --parents     no error if existing, make parent directories as needed 如果路徑中有個目錄不存在,則創(chuàng)建它
  -v, --verbose     print a message for each created directory 會顯示出提示信息。這個選項許多命令里都會有。大至是一個提示的作用,讓我們用戶可以看到操作的結(jié)果。
  -Z, --context=CTX  set the SELinux security context of each created
                      directory to CTX
      --help     顯示此幫助信息并退出
      --version  輸出版本信息并退出
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權(quán)所有   京ICP備16069177號 | 京公網(wǎng)安備11010502021702
快速回復(fù) 返回頂部 返回列表