亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unx03.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx03.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unx04.htm">

<LINK REL="Previous" HREF="unx02.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx02.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unx04.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P><UL>

<LI>

<A HREF="#I1">3 &#151; The UNIX File System Go Climb a Tree</A></LI>

<UL>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I3">By Jeff Smith</A></LI></UL></UL>

<LI>

<A HREF="#I4">The Types of UNIX Files</A></LI>

<LI>

<A HREF="#I5">Creating Listing, and Viewing Files</A></LI>

<LI>

<A HREF="#I6">The UNIX File Tree</A></LI>

<LI>

<A HREF="#I7">File and Directory Names</A></LI>

<LI>

<A HREF="#I8">Creating Directories with mkdir</A></LI>

<LI>

<A HREF="#I9">Working with Files</A></LI>

<UL>

<LI>

<A HREF="#I10">Copying Files with cp</A></LI>

<LI>

<A HREF="#I11">Moving Files with mv</A></LI>

<LI>

<A HREF="#I12">Removing Files with rm</A></LI></UL>

<LI>

<A HREF="#I13">Working with Directories</A></LI>

<UL>

<LI>

<A HREF="#I14">Creating Multiple Directories with mkdir</A></LI>

<LI>

<A HREF="#I15">Removing a Directory with rmdir</A></LI>

<LI>

<A HREF="#I16">Renaming Directories with mv</A></LI>

<LI>

<A HREF="#I17">Keeping Secrets &#151; File and Directory Permissions</A></LI></UL>

<LI>

<A HREF="#I18">Default File and Directory Permissions&#151;Your umask</A></LI>

<LI>

<A HREF="#I19">Hard and Symbolic Links</A></LI>

<LI>

<A HREF="#I20">Summary</A></LI></UL></UL></UL>



<H1 ALIGN="CENTER">

<CENTER><A ID="I1" NAME="I1">

<BR>

<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>3 &#151; The UNIX File System Go Climb a Tree</B>

<BR></FONT></A></CENTER></H1>

<H5 ALIGN="CENTER">

<CENTER><A ID="I3" NAME="I3">

<FONT SIZE=3><B>By Jeff Smith</B>

<BR></FONT></A></CENTER></H5>

<P>When you work with UNIX, one way or another you spend most of your time working with files. In this chapter, you learn how to create and remove files, copy and rename them, create links to them, and use directories to organize your files so that you can 

find them later. You also learn how to view your files, list their names and sizes, and move around in the UNIX file tree. Finally, this chapter shows how you can choose to share or restrict the information in your files.

<BR></P>

<P>One of UNIX's greatest strengths is the consistent way in which it treats files. Although some operating systems use different types of files that each require unique handling, you can handle most UNIX files the same. For instance, the cat command, 
which displays a disk file on your terminal screen, can also send the file to the printer. As far as cat (and UNIX) are concerned, the printer and your terminal look the same, and they look like any other UNIX file. UNIX also doesn't distinguish between 
files that you create and the standard files that come with the operating system&#151;as far as UNIX is concerned, a file is a file is a file. This consistency makes it easy to work with files because you don't have to learn special commands for every new 

task. Often, as in the cat example, you can use the same command for several purposes. This makes it easy to write UNIX programs because you usually don't have to worry whether you're talking to a terminal, a printer, or an ordinary file on a disk drive.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I4" NAME="I4">

<FONT SIZE=4><B>The Types of UNIX Files</B>

<BR></FONT></A></CENTER></H3>

<P>There are three types of UNIX files: regular files, directories, and device files. Regular files hold executable programs and data. Executable programs are the commands (such as cat) that you enter. Data is information that you store for later use. Such 

information can be virtually anything: a USENET news article with a promising-looking recipe for linguini, a book that you are writing, a homework assignment, or a saved spreadsheet.

<BR></P>

<P>Directories are files that contain other files and subdirectories, just as a filing cabinet's drawers hold related folders. Directories help you organize your information by keeping closely related files in the same place so you can find them later. For 

instance, you might save all your spreadsheets in a single directory instead of mixing them with your linguini recipes and book chapters.

<BR></P>

<P>As in the cat example, files can also refer to computer hardware such as terminals and printers. These device files can also refer to tape and disk drives, CD-ROM players, modems, network interfaces, scanners, and any other piece of computer hardware. 
Under UNIX, even the computer's memory is a file.

<BR></P>

<P>Although UNIX treats all files similarly, some require slightly unique treatment. For example, UNIX treats directories specially in some ways. Also, because they refer directly to the computer's hardware, device files sometimes must be treated 
differently from ordinary files. For instance, most files have a definite size in bytes&#151;the number of characters they contain. Your terminal's keyboard is a device file, but how many characters does it hold? The question of file size doesn't make 
sense in this case. Despite these differences, UNIX commands usually don't distinguish among the various types of files.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I5" NAME="I5">

<FONT SIZE=4><B>Creating Listing, and Viewing Files</B>

<BR></FONT></A></CENTER></H3>

<P>You can create files in many ways, even if you don't yet know how to use a text editor. One of the easiest ways is to use the touch command, as follows:

<BR></P>

<PRE>$ touch myfile</PRE>

<P>This command creates an empty filenamed myfile.

<BR></P>

<P>An empty file isn't much good except as a place holder that you can fill in later. If you want to create a file that contains some text, you can use either the echo or cat command. The echo command is a simple but useful command that prints its 
command-line arguments to stdout, the standard output file, which by default is your terminal screen. For instance, enter the following:

<BR></P>

<PRE>$ echo Will Rogers

Will Rogers</PRE>

<P>The words Will Rogers are echoed to your terminal screen.

<BR></P>

<P>You can save the words by using your shell's file redirection capability to redirect echo's standard output to a different file:

<BR></P>

<PRE>$ echo Will Rogers &gt; cowboys</PRE>

<P>Notice that the preceding command does not send output to your terminal; the greater-than sign tells your shell to redirect echo's output into cowboys.

<BR></P>

<P>You can view the contents of cowboys with cat, as follows:

<BR></P>

<PRE>$ cat cowboys

Will Rogers</PRE>

<P>If you want to add more text to a file, use two greater-than signs:

<BR></P>

<PRE>$ echo Roy Rogers &gt;&gt; cowboys</PRE>

<P>Now cat shows both lines:

<BR></P>

<PRE>$ cat cowboys

Will Rogers

Roy Rogers</PRE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="caution.gif" WIDTH = 37 HEIGHT = 35><B>CAUTION: </B>When you use the greater-than sign to create a file, your shell creates a zero-length file (just as touch does) and then fills it. If the file already exists, your shell first destroys its 
contents to make it zero-length. You must use two greater-than signs to append new text to a file or you will destroy your earlier work.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>The cat command doesn't just display files. It also can create them by using shell redirection. If you plan to enter several lines of text, cat is more convenient than echo:

<BR></P>

<PRE>$ cat &gt; prufrock

Let us go then, you and I,

When the evening is spread out against the sky

Like a patient etherised upon a table;</PRE>

<P>Then press Ctrl+D. This keystroke is the default end-of-file character; it tells cat that you are done typing.

<BR></P>

<P>Now you have a filenamed prufrock, and you can view it by using the cat command:

<BR></P>

<PRE>$ cat prufrock

Let us go then, you and I,

When the evening is spread out against the sky

Like a patient etherised upon a table;</PRE>

<P>Note that cat does not print the end-of-file character when you display the file.

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> When you create a file with cat, you can use your character-erase, word-erase, and line-kill characters (see Chapter 7, &quot;Text Editing with vi, EMACS, and sed Files&quot;) to correct typing 
mistakes in the current line. After you press Enter, you cannot make corrections. To correct such a mistake, you must learn to use a text editor (see Chapter 7).

<BR></NOTE>

<HR ALIGN=CENTER>

<P>It may seem odd that cat both creates and displays files, but this is normal for UNIX; that is, it's normal for commands not to know one type of file from another. The name cat derives from the word catenate, which means to connect in a series or to 
link together. The cat command doesn't care which file it receives as input or where the output goes. Because UNIX handles your terminal keyboard and screen as ordinary files, when you enter cat cowboys, cat catenates cowboys to your terminal screen, and 
when you enter cat &gt; prufrock, the command catenates what you enter into a disk file. You can even run cat without specifying an input or output file:

<BR></P>

<PRE>$ <B>cat</B>

Let us go then, you and I,

Let us go then, you and I,

When the evening is spread out against the sky

When the evening is spread out against the sky</PRE>

<P>Press Ctrl+D to insert an end-of-file.

<BR></P>

<P>The cat command echos to your screen every line that you enter before Ctrl+D because, by default, cat uses your terminal keyboard as its input file and your screen as its output file. Like other UNIX commands, cat treats files quite consistently and 
therefore is very flexible.

<BR></P>

<P>The cat command works well for short files that fit on a single terminal screen, but if you try to display a longer file, all but the last lines of it scroll off your screen. To view long files, you can temporarily freeze your terminal screen by typing 

Ctrl+S and restart it by typing Ctrl+Q. However, if your terminal is fast, you may not be able to stop it quickly enough. Pagers like pg and more pause after every screen. (See Chapter 4, &quot;Listing Files.&quot;)

<BR></P>

<P>Now that you have some files, you may want to list them or view their names. The ls (list files) command can display each file's name, size, and time of creation, and also which users have permission to view, modify, and remove them.

<BR></P>

<P>If you want to know only the names of the files, enter the following:

<BR></P>

<PRE>$ <B>ls</B>

cowboys prufrock</PRE>

<P>If you have many files, you may want to view only some of them. If you want ls to list specific files, you can specify their names on the command line:

<BR></P>

<PRE>$ ls prufrock

prufrock</PRE>

<P>This output isn't very useful; you already know the name of the file, so there's not much point in listing it. However, you can use ls in this way to find out whether a certain file exists. If the file doesn't exist, ls prints an error message, as 
follows:

<BR></P>

<PRE>$ ls alfred_j

alfred_j: No such file or directory</PRE>

<P>The message No such file or directory means exactly what it says: You don't have a filenamed alfred_j.

<BR></P>

<P>A better application of this feature of ls is to use your shell's metacharacters or wild cards to list a file when you know only part of its name. (For more information on metacharacters and wild cards, see Chapter 11, &quot;Bourne Shell,&quot; Chapter 

12, &quot;Korn Shell,&quot; and Chapter 13, &quot;C Shell.&quot;) With shell wild cards, you can specify parts of filenames and let your shell fill in the rest. Suppose that you can't remember the name of the file that includes the linguini recipe, but you 

remember that it starts with the letter l. You could enter <B>ls</B> and then search through a list of all your files to find the one that you want. However, the following command makes the search easier:

<BR></P>

<PRE>$ ls l*

linguini   local_lore</PRE>

<P>The l* argument narrows your listing by telling ls that you're interested only in files that begin with an l, followed by zero or more of any other characters. The ls command ignores the files cowboys and prufrock, and lists only those files beginning 
with the letter l.

<BR></P>

<P>Wild cards are a powerful method for narrowing your file listings. Throughout this chapter, you'll see many uses for wild cards. Because they are a characteristic of your shell and not the commands you invoke from your shell, wild cards work equally 
well with other commands, such as cat. For instance, you could enter the following command to display both your linguini recipe and the file local_lore:

<BR></P>

<PRE>$ cat l*</PRE>

<P>However, different shells may use different wild cards, or use the same ones in different ways. This chapter provides examples only of the wild cards that are common to all shells. To learn how your shell uses wild cards, see Chapters 12 (&quot;Korn 
Shell&quot;) and 13 (&quot;C Shell&quot;) and your shell's manual page.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I6" NAME="I6">

<FONT SIZE=4><B>The UNIX File Tree</B>

<BR></FONT></A></CENTER></H3>

<P>As mentioned in the introduction to this chapter, your personal files usually contain data&#151;information that you want the computer to save when you're not logged in. If you use UNIX for a long time, you'll accumulate hundreds or even thousands of 
files, and thousands more system files that are a standard part of UNIX. How can you keep all these files organized and find the ones that you want when you need them?

<BR></P>

<P>The designers of UNIX solved this problem by using directories to organize the UNIX file system into a structure that is shaped like an upside-down tree. Directories enable you to keep related files in one place, where you see them only when you 
want&#151;after all, you needn't clutter your file listings with recipes when you're working with a spreadsheet.

<BR></P>

<P>Figure 3.1 shows part of the file tree for a typical UNIX system. In this drawing, which looks somewhat like an upside-down tree, names like home and jane are followed by a slash (/), which indicates that they are directories, or files of files. Note 
that ordinary files, such as cowboys and prufrock, are not followed by a slash. Such files are called leaves because they aren't connected to anything else. The connecting lines are the paths through the UNIX file tree. You can move around the tree by 
following the paths.

<BR></P>

<P>

<BR><B><A HREF="03unx01.gif">Figure 3.1. The file tree for a typical UNIX </B><B>system.</A></B>

<BR></P>

<P>Notice also that two files are named prufrock. How can two files have the same name? And when you enter <B>cat prufrock</B>, how does UNIX know which one you want? Don't worry&#151;your shell can distinguish one prufrock file from the other, for two 
reasons.

<BR></P>

<P>First, UNIX shells always remember their current working directory (CWD). The CWD is the directory in the file tree that you're in at any particular time. If you move somewhere else in the tree, the CWD changes. For example, if you're in the directory 
jane and you enter <B>cat </B><B>prufrock</B>, you see the prufrock file that is attached to that directory; if you're in the tmp directory, you see the file attached to that directory.

<BR></P>

<P>Second, although so far you have named files by using relative pathnames, UNIX translates these pathnames into fully qualified pathnames. Fully qualified pathnames (or full pathnames) begin with a slash. Every file in the file tree has a unique, fully 
qualified pathname, which you construct by following the connecting lines from the root to the file. For instance, the following is the fully qualified pathname of the file prufrock in the directory jane:

<BR></P>

<PRE>/home/jane/prufrock</PRE>

<P>To construct this unique name, you follow the path from the root directory (/) through the directories home and jane, and end with the file prufrock. UNIX uses the slash to separate the different parts of the pathname. This character is also the special 

name for the root of the tree. Because it has this special meaning, the slash is one of the few characters that you cannot use in a UNIX filename.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
xnxx国产精品| 日韩午夜激情视频| 精品国产乱码久久久久久1区2区| 欧美亚日韩国产aⅴ精品中极品| 国产日产欧美精品一区二区三区| 日本欧美一区二区| 欧美一区二区三区四区五区| 亚洲成av人片在www色猫咪| 91精品国产综合久久蜜臀| 国产又黄又大久久| 亚洲色图丝袜美腿| 日韩久久久精品| 色哟哟一区二区三区| 另类人妖一区二区av| 亚洲日本一区二区| 日韩欧美激情一区| 色婷婷久久综合| 成人精品一区二区三区四区| 日日夜夜一区二区| 综合久久一区二区三区| 69p69国产精品| 欧美性色aⅴ视频一区日韩精品| 午夜精品久久久久| 国产精品久久久久久久蜜臀| 欧美成人在线直播| 欧美猛男超大videosgay| 成人免费视频视频| 国产乱码一区二区三区| 日本特黄久久久高潮| 亚洲精品国产第一综合99久久| 69堂成人精品免费视频| 精品视频在线免费| 91麻豆精品在线观看| 久久超碰97中文字幕| 亚洲国产一区二区三区 | 无码av免费一区二区三区试看| 中文字幕在线免费不卡| www.欧美日韩国产在线| 精品写真视频在线观看| 国产黑丝在线一区二区三区| 国产乱码精品一区二区三| 国产综合色精品一区二区三区| 国产精品午夜春色av| 国产精品久99| 亚洲欧美另类久久久精品 | 欧美中文字幕一区二区三区亚洲| 久久激情五月婷婷| 成人av片在线观看| 欧美视频三区在线播放| 91麻豆精品国产自产在线观看一区| eeuss鲁一区二区三区| 欧美日韩电影一区| 久久影视一区二区| 伊人开心综合网| 国产一区二区影院| 欧美视频一区在线| 国产婷婷色一区二区三区| 亚洲综合另类小说| 国产丶欧美丶日本不卡视频| 欧美日韩一级二级三级| 国产肉丝袜一区二区| 亚洲国产成人精品视频| 成人动漫一区二区| 久久夜色精品一区| 美女国产一区二区| 欧美精品自拍偷拍动漫精品| 国产精品久久久久精k8| 国产精品自拍三区| 日韩欧美成人午夜| 午夜精彩视频在线观看不卡| 97久久精品人人澡人人爽| 国产日韩在线不卡| 国产不卡视频一区二区三区| 欧美tickling挠脚心丨vk| 午夜免费久久看| 狠狠色狠狠色综合| 欧美日韩国产一区| 亚洲成av人片| 欧美一区在线视频| 国产精品69久久久久水密桃| 久久综合色鬼综合色| 国产宾馆实践打屁股91| 国产亚洲一区二区三区在线观看| 日韩和欧美一区二区三区| 日韩欧美一二三四区| 国产又黄又大久久| 亚洲精品国产无套在线观| 欧美三级视频在线| 国产成人丝袜美腿| 亚洲视频中文字幕| 欧美一卡二卡在线| 国产一区二区三区在线观看免费| 欧美变态tickling挠脚心| 99精品视频一区二区三区| 日韩黄色免费网站| 中文字幕一区三区| 欧美电影免费观看完整版| 91玉足脚交白嫩脚丫在线播放| 中文字幕一区二| 欧美精品一级二级三级| 粉嫩aⅴ一区二区三区四区五区 | 成人激情视频网站| 亚洲一二三区不卡| 国产精品久久久久精k8| 日韩欧美一区二区三区在线| 色欧美日韩亚洲| av午夜一区麻豆| 丰满岳乱妇一区二区三区| 日本vs亚洲vs韩国一区三区二区| 日韩一本二本av| 欧美精品成人一区二区三区四区| 国产一区二区伦理片| 加勒比av一区二区| 国产一区免费电影| 国产经典欧美精品| 国内精品国产三级国产a久久| 亚洲欧美日韩精品久久久久| 欧美无乱码久久久免费午夜一区 | 色综合久久88色综合天天| 国产ts人妖一区二区| 国产高清成人在线| caoporen国产精品视频| 91片在线免费观看| 欧美最新大片在线看| 欧美日韩一卡二卡| 日韩一区二区三区在线| 精品国产91久久久久久久妲己| 欧美一区二区观看视频| www一区二区| 亚洲青青青在线视频| 丝袜诱惑制服诱惑色一区在线观看| 亚洲人成小说网站色在线| 天堂在线亚洲视频| 国产一区二区不卡| 色婷婷综合久久久久中文 | 色猫猫国产区一区二在线视频| 国产成人精品在线看| 欧美日韩精品是欧美日韩精品| 欧美性大战xxxxx久久久| 国产亚洲一二三区| 偷拍亚洲欧洲综合| www.性欧美| 精品国产凹凸成av人导航| 亚洲视频你懂的| 国产成人免费在线观看不卡| 91久久精品午夜一区二区| 51精品久久久久久久蜜臀| 中文字幕欧美区| 激情综合一区二区三区| 制服视频三区第一页精品| 亚洲精品视频自拍| 日本高清无吗v一区| 中文字幕乱码日本亚洲一区二区| 亚洲影院理伦片| 91精彩视频在线| 亚洲自拍欧美精品| 欧美日韩国产乱码电影| 亚洲精品视频免费观看| 在线亚洲+欧美+日本专区| 最新高清无码专区| 色综合咪咪久久| 午夜久久电影网| 91蝌蚪porny九色| 国产日韩精品一区二区三区 | 欧美午夜宅男影院| 亚洲乱码国产乱码精品精小说 | 日韩精品国产精品| 91精品欧美福利在线观看| 免费人成精品欧美精品| 日韩久久久精品| 99久久精品国产观看| 香蕉影视欧美成人| 久久色.com| 欧洲一区二区三区在线| 日韩av在线发布| 国产精品私房写真福利视频| 99久久精品国产麻豆演员表| 日韩中文欧美在线| 国产精品人人做人人爽人人添| 国产激情91久久精品导航| 依依成人综合视频| 久久精品亚洲一区二区三区浴池| 久久精品噜噜噜成人88aⅴ| 中文一区一区三区高中清不卡| 国产精品99久久久| 蜜桃精品视频在线观看| 亚洲乱码中文字幕| 久久精品人人做| 日本一二三四高清不卡| 欧美无砖砖区免费| 91浏览器打开| av不卡一区二区三区| 国产凹凸在线观看一区二区| 视频一区视频二区中文| 亚洲影院免费观看| 一区二区免费视频| 亚洲大片精品永久免费| 亚洲日本在线a| 一区二区三区丝袜| 亚洲精品国久久99热|