• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            /dev/null與/dev/zero詳解

            Posted on 2009-08-28 13:40 Prayer 閱讀(988) 評論(0)  編輯 收藏 引用 所屬分類: Shell
            /dev/null,外號叫無底洞,你可以向它輸出任何數據,它通吃,并且不會撐著!
            /dev/zero,是一個輸入設備,你可你用它來初始化文件。
            /dev/null------它是空設備,也稱為位桶(bit bucket)。任何寫入它的輸出都會被拋棄。如果不想讓消息以標準輸出顯示或寫入文件,那么可以將消息重定向到位桶。
            /dev/zero------該設備無窮盡地提供0,可以使用任何你需要的數目——設備提供的要多的多。他可以用于向設備或文件寫入字符串0。

            oracle@localhost oracle]$if=/dev/zero of=./test.txt bs=1k count=1
            oracle@localhost oracle]$ ls -l
            total 4
            -rw-r--r-- 1 oracle dba 1024 Jul 15 16:56 test.txt

            eg,

            find / -name access_log 2>/dev/null

            這樣,一些諸如一些錯誤信息就不會顯示出來。



            ==============================================================================
            /dev/null:

            In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it, and provides no data to any process that reads from it (it returns EOF). In Unix programmer jargon, it may also be called the bit bucket or black hole.

            The null device is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams. This is usually done by redirection.

            This entity is a common inspiration for technical jargon expressions and metaphors by Unix programmers, e.g. "please send complaints to /dev/null" or "my mail got archived in /dev/null", being jocular ways of saying, respectively: "don't bother to send any complaints" and "my mail got deleted". A famous advertisement for the Titanium PowerBook G4 read [The Titanium Powerbook G4] Sends other UNIX boxes to /dev/null.

            The null device is also a favorite subject of technical jokes, such as warning users that the system's /dev/null is already 98% full. The April Fool's, 1995 issue of the German magazine c't reported on an enhanced /dev/null chip that would efficiently dispose of the incoming data by converting it to flicker on an internal glowing LED.

            /dev/null is a special file, not a directory (folder), so one cannot move files into it with the Unix mv command. See rm for the proper way to delete files in Unix.

            The equivalent device in CP/M (and later DOS and Windows) is called NUL:, and on some versions of DOS just NUL (for example, one may hide output by directing it to NUL, e.g. PAUSE>NUL, which waits for the user to press any key without printing anything to the screen). Under classic Amiga operating systems, the device's name is NIL:. In Windows NT and its successors, it is named \Device\Null internally, though, the DOS NUL is a symbolic link to it. Similarly, in OpenVMS the device is named NL:.


            /dev/zero:

            In Unix-like operating systems, /dev/zero is a special file that provides as many null characters (ASCII NULL, 0x00; not ASCII character "digit zero", "0", 0x30) as are read from it. One of the typical uses is to provide a character stream for overwriting information. Another might be to generate a clean file of a certain size. Using mmap to map /dev/zero to RAM is the BSD way of implementing shared memory.

            # Initialise partition (important note: trying out this command will eradicate
            # any files that were on the partition, make sure you have a backup of any important data.)
            dd if=/dev/zero of=/dev/hda7

            # Create a large empty file called 'foobar'
            dd if=/dev/zero of=foobar count=1000 bs=1000

            Like /dev/null, /dev/zero acts as a source and sink for data. All writes to /dev/zero succeed with no other effects (the same as for /dev/null, although /dev/null is the more commonly used data sink); all reads on /dev/zero return as many NULs as characters requested.

            原文地址 http://blog.chinaunix.net/u/15620/showart.php?id=265056
            一本色道久久综合狠狠躁| 久久精品国产91久久麻豆自制| 久久精品夜色噜噜亚洲A∨| 精品多毛少妇人妻AV免费久久| 欧美精品丝袜久久久中文字幕 | 久久综合给合久久国产免费 | 丁香色欲久久久久久综合网| 国产精品久久成人影院| 久久成人小视频| 九九热久久免费视频| 久久久久久夜精品精品免费啦 | 久久精品人妻中文系列| 人人狠狠综合久久88成人| 国产综合精品久久亚洲| 麻豆一区二区99久久久久| 久久婷婷人人澡人人| 91精品无码久久久久久五月天| 国产69精品久久久久久人妻精品| 久久国产免费直播| 久久99热狠狠色精品一区| 久久久久久国产精品免费无码 | 精品久久久无码中文字幕| 久久99精品久久久久婷婷| 久久天天躁狠狠躁夜夜avapp| 久久久精品人妻无码专区不卡| 精品免费tv久久久久久久| 久久精品aⅴ无码中文字字幕重口| 性做久久久久久久久| 美女久久久久久| 久久精品国产亚洲5555| 精品久久久久久无码中文字幕 | 国产美女亚洲精品久久久综合| 日韩欧美亚洲综合久久影院Ds| 开心久久婷婷综合中文字幕| 久久久久亚洲AV无码专区桃色| 久久久WWW免费人成精品| 精品一久久香蕉国产线看播放| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 | 久久99精品久久久久久不卡| 国产巨作麻豆欧美亚洲综合久久| 青青青青久久精品国产h|