Home HomeLinux. .Mandrake.10.Podręcznik.Użytkownika.[eBook.PL]Kirch O, Dawson T Linux. Podręcznik administratora sieciLinux administracja sieciami zaawansowane ( 554 strony )Teach yourself linux in 24 hoursTrevor Kay Linux Certification BibleLesioRoger Manvell, Heinrich Fraenkel GoeringGail Z. Martin Polegli królowie 01 ZaprzysiężeniWeis M., T. Hickman Smoki jesiennego zmierzchu 1Andrzej Sapkowski 1. Krew Elfow
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • moje-waterloo.xlx.pl
  •  

    [ Pobierz całość w formacie PDF ]
    .1 The Power of UnixThe power of Unix is hidden in small commands that don't seem too useful when used alone, butwhen combined with other commands either directly or indirectly produce a system that's muchmore powerful and exible than most other operating systems.The commands I'm going to talkabout in this chapter include sort, grep, more, cat, wc, spell, diff, head, and tail.Unfortunately,it isn't totally intuitive what these names mean right now.Let's cover what each of these utilities do seperately and then I'll give some examples of howtouse them together.11Please note that the short summaries on commands in this chapter are not comprehensive.Please consult the61 62 CHAPTER 7.POWERFUL LITTLE PROGRAMS7.2 Operating on FilesIn addition to the commands like cd, mv, and rm you learned in Chapter 4, there are other commandsthat just operate on les but not the data in them.These include touch, chmod, du, and df.Allof these les don't care what is in the le|the merely change some of the things Unix remembersabout the le.Some of the things these commands manipulate:The time stamp.Each le has three dates associated with it.2 The three dates are the creationtime when the le was created , the last modi cation time when the le was last changed ,and the last access time when the le was last read.The owner.Every le in Unix is owned by one user or the other.The group.Every le also has a group of users it is associated with.The most common groupfor user les is called users, which is usually shared by all the user account on the system.The permissions.Every le has permissions sometimes called privileges" associated with itwhich tell Unix who can access what le, or change it, or, in the case of programs, execute it.Each of these permissions can be toggled seperately for the owner, the group, and all otherusers.touch le1 le2.leNtouch will update the time stamps of the les listed on the command line to the current time.If a le doesn't exist, touch will create it.It is also possible to specify the time that touch will setles to|consult the the manpage for touch.chmod -Rfv mode le1 le2.leNThe command used to change the permissions on a le is called chmod, short for change mode.Before I go into how to use the command, let's discuss what permissions are in Unix.Each le has agroup of permissions associated with it.These permissions tell Unix whether or not the le can beread from, written to, or executed as a program.In the next few paragraphs, I'll talk about usersdoing these things.Any programs a user runs are allowed to do the same things a user is.This canbe a security problem if you don't know what a particular program does.Unix recognizes three di erent types of people: rst, the owner of the le and the person allowedto use chmod on that le.Second, the group".The group of most of your les might be users",meaning the normal users of the system.To nd out the group of a particular le, use ls -l le.command's manpage if you want to knowevery option.2Older lesystems in Linux only stored one date, since they were derived from Minix.If you have one of theselesystems, some of the information will merely be unavailable|operation will be mostly unchanged. 7.3.SYSTEM STATISTICS 63Then, there's everybody else who isn't the owner and isn't a member of the group, appropriatelycalled other".So, a le could have read and write permissions for the owner, read permissions for the group,and no permissions for all others.Or, for some reason, a le could have read write permissions forthe group and others, but no permissions for the owner!Let's try using chmod to change a few permissions.First, create a new le using cat, emacs, orany other program.By default, you'll be able to read and write this le.The permissions givenother people will vary depending on how the system and your account is setup.Make sure you canread the le using cat.Now, let's take away your read privilege by using chmod u-r lename.Theparameter u-r decodes to user minus read".Nowif you try to read the le, you get a Permissiondenied error! Add read privileges back by using chmod u+r lename.Directory permissions use the same three ideas: read, write, and execute, but act slightly di er-ently.The read privilege allows the user or group or others to read the directory|list the namesof the les.The write permission allows the user or group or others to add or remove les.Theexecute permission allows the user to access les in the directory or any subdirectories.If a userdoesn't have execute permissions for a directory, they can't even cd to it!To use chmod, replace the mode with what to operate on, either user, group, other, or all, andwhat to do with them.That is, use a plus sign to indicate adding a privilege or a minus signto indicate taking one away.Or, an equals sign will specify the exact permissions.The possiblepermissions to add are read, write, and execute.chmod's R ag will change a directory's permissions, and all les in that directory, and all subdi-recties, all the way down the line [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • syriusz777.pev.pl
  •