亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩国产免费一区二区| 精品少妇一区二区三区免费观看| 精品国产伦一区二区三区免费| 亚洲自拍偷拍九九九| 色悠久久久久综合欧美99| 中文字幕不卡一区| 91浏览器打开| 亚洲蜜臀av乱码久久精品蜜桃| av毛片久久久久**hd| 亚洲欧美另类综合偷拍| 欧美性大战久久久久久久蜜臀| 一区二区欧美精品| 3d动漫精品啪啪1区2区免费| 亚洲一区二区黄色| 日韩一区二区麻豆国产| 精品无码三级在线观看视频| 欧美激情一区二区在线| 一本一道波多野结衣一区二区| 一区二区三区四区在线免费观看| 欧美性猛片aaaaaaa做受| 美国十次了思思久久精品导航| 日韩欧美电影在线| 色综合久久久久久久久久久| 亚洲大型综合色站| 国产日韩欧美a| 欧美日韩视频第一区| 国产盗摄视频一区二区三区| 亚洲综合无码一区二区| 26uuu亚洲综合色欧美| 色系网站成人免费| 国产九色精品成人porny| 亚洲一级不卡视频| 国产精品久线在线观看| 精品99一区二区| 欧美精品少妇一区二区三区| 91丝袜美腿高跟国产极品老师| 免费国产亚洲视频| 亚洲国产一区在线观看| 中文字幕五月欧美| 久久精品视频一区二区| 在线电影一区二区三区| 欧美视频自拍偷拍| 色94色欧美sute亚洲线路二| 成人美女在线观看| 国产盗摄女厕一区二区三区| 久久国产福利国产秒拍| 欧美aⅴ一区二区三区视频| 亚洲综合在线电影| 一区二区三区精品久久久| 国产精品狼人久久影院观看方式| 欧美精品一区视频| 国产欧美一区二区三区鸳鸯浴 | 丰满亚洲少妇av| 91麻豆精品91久久久久久清纯| 日韩成人av影视| 中文字幕日韩一区二区| www精品美女久久久tv| 国产精品综合视频| 青青草国产精品97视觉盛宴| 婷婷丁香久久五月婷婷| 爽爽淫人综合网网站| 青青草成人在线观看| 久久精品国产久精国产| 国产成人夜色高潮福利影视| 成人激情av网| 欧美日韩国产中文| 日韩一二三区不卡| 欧美日韩亚洲国产综合| 成人不卡免费av| 欧美男女性生活在线直播观看| 欧美一区在线视频| 国产精品第13页| 视频一区在线视频| 成人黄色综合网站| 欧美一区二区视频在线观看| 中文字幕不卡在线| 秋霞影院一区二区| 色综合天天综合网国产成人综合天 | 亚洲一区二区免费视频| 国产精品一区2区| 在线观看av不卡| 国产目拍亚洲精品99久久精品| 亚洲一卡二卡三卡四卡五卡| 高清久久久久久| 欧美精品一区二区三区高清aⅴ| 亚洲精品成人a在线观看| av电影在线观看一区| 欧美日韩高清一区| 亚洲视频在线观看三级| 国产成人日日夜夜| 久久久高清一区二区三区| 日本中文字幕不卡| 3d成人h动漫网站入口| 亚洲资源在线观看| 9久草视频在线视频精品| 国产欧美视频一区二区三区| 久久丁香综合五月国产三级网站| 欧美综合在线视频| 一区二区三区精品视频在线| 91成人网在线| 亚洲最新在线观看| 欧美精品电影在线播放| 日本一不卡视频| 精品国产一区二区在线观看| 国内成人精品2018免费看| 2017欧美狠狠色| 不卡电影免费在线播放一区| 综合久久给合久久狠狠狠97色| 国产iv一区二区三区| 一区二区三区中文字幕精品精品 | 国产精品青草综合久久久久99| 国产精品亚洲成人| 成人免费在线观看入口| 在线亚洲精品福利网址导航| 婷婷综合另类小说色区| 精品女同一区二区| 99vv1com这只有精品| 偷窥少妇高潮呻吟av久久免费| xvideos.蜜桃一区二区| gogogo免费视频观看亚洲一| 亚洲综合色视频| 欧美sm美女调教| 91成人网在线| 国产精品一区在线观看乱码| 亚洲永久精品国产| 久久久久亚洲综合| 欧美一区二区二区| 色综合一区二区| 色婷婷亚洲精品| 欧美少妇一区二区| 国产乱人伦偷精品视频免下载| 国产精品白丝在线| 久久免费午夜影院| 欧美日韩1区2区| 日本国产一区二区| 91色在线porny| 成人免费av在线| 国产在线乱码一区二区三区| 日韩电影免费在线| 视频在线观看一区二区三区| 亚洲人成影院在线观看| 亚洲视频在线观看三级| 国产精品天天看| 中文一区二区在线观看| 精品成人佐山爱一区二区| 国产精品剧情在线亚洲| 国产精品久久久久国产精品日日| 在线不卡欧美精品一区二区三区| 天天影视网天天综合色在线播放| 国产日韩精品一区二区浪潮av| 国产精品99久| 亚洲欧美激情一区二区| 色成年激情久久综合| 加勒比av一区二区| 国产精品66部| 成人网在线免费视频| www.亚洲人| 成人免费高清视频| 一本到不卡精品视频在线观看| 不卡的av网站| 欧美午夜一区二区三区 | 久久精品国产澳门| 国产成人综合自拍| 久久99久久久欧美国产| 日本怡春院一区二区| 粉嫩av一区二区三区在线播放 | 欧美日韩不卡在线| 日韩欧美高清一区| 最新久久zyz资源站| 午夜精品久久久久久久99水蜜桃| 日韩精品欧美精品| 波多野结衣精品在线| 制服丝袜中文字幕亚洲| 国产精品每日更新在线播放网址 | 欧美一级欧美一级在线播放| 久久久久久亚洲综合| 舔着乳尖日韩一区| zzijzzij亚洲日本少妇熟睡| 这里只有精品免费| 亚洲欧美视频一区| 国产露脸91国语对白| 欧美日韩亚洲国产综合| 17c精品麻豆一区二区免费| 免费在线观看精品| 欧美日韩精品一区二区在线播放| 中文字幕乱码久久午夜不卡| 免费成人性网站| 欧美日韩免费高清一区色橹橹| 亚洲国产成人私人影院tom| 精品在线观看视频| 在线电影一区二区三区| 亚洲激情自拍视频| 99久久精品国产网站| 国产精品素人视频| 成人免费高清视频在线观看| 欧美xxxxxxxx| 粉嫩13p一区二区三区| 国产日产欧美一区| 99精品国产视频| 亚洲色图在线看|