Operating Systems > Linux and UNIX

i need book which explains mix of the kernel and commands

(1/3) > >>

Chooco:
LINUX

ok well i'm a newb so i don't know a lot of the commands. i want a book which explains a bit about how Linux as a kernel works. i also need a book with commands....such as how chmod works and where the number 755 comes from in 1 case. just need more commands  

i've been keeping my eye on that O'Reilly book Understand The LINUX Kernel and i'm thinking that would be a good explanation of what exactly Linux is and how it works. what would you recommend for the commands thing?

voidmain:
I've explained the permissions, chmod, and umask before in these forums. It might still be here somewhere. But any beginner UNIX book should explain them. For n00bs the "unleashed" books are probably pretty good (ReHat Unleashed, or Linux Unleashed).  And I recommend *any* O'Reilly book, they don't put out a bad book.

For permissions, if you do an "ls -al" command it will show a "long" list of "all" the files in the current directory along with the permissions, the owner of the files, and the group assignment, number of links, size, date/time, and name of the files. For instance, you might see one called ".bash_history" which contains your history of commands that you have typed at the command line and it might look something like this:


--- Code: ---
--- End code ---

Permissions: -rw-------
Links: 1
Owner: yourusername
Group: yourgroupname
Size: 15511 bytes
Date: Jun 9
Time: 08:28
Name: .bash_history

The basic permissions are broken out into four sections, the first position indicating the type of file. In the above example the first "-" means it is a normal file. If the first character were a "d" it would indicate a directory, an "l" would indicate a link to another file or directory, a "b" is a block device, a "c" is a character device, and there are a few more. The actual permissions are the next 9 positions in that list in this case "rw-------". Those nine positions should be broken into 3 sets of 3 positions. The first set of 3 is the permissions for the "owner" of the file (yourusername in this case), the second 3 positions are the permissions for the "group" assigned to this file (yourgroupname in this example) and the last three positions are the permissions for "other" (or everyone). In this example only "yourusername" has read/write access to the file. No one else on the system as access to view or modify or execute the file. If the file is to be executable as well as readable/writable only by you it should have looked like this: "-rwx------". If you think of those 3 groups of permissions as three 3 bit numbers then "rwx" would be "111", "rw-" would be "110". In octal that would be "7" or "6". The chmod command can set permissions either by name or by their octal representation.  Say you want to set a file Read/Write/Execute for the owner but Read/Execute for everyone else it typically would look like "-rwxr-xr-x" or "-111101101" or "755" if converted to octal. There are several ways you could change your ".bash_history" file to have those permissions using chmod:

chmod u=rwx,g=rx,o=rx .bash_history
or
chmod 755 .bash_history
or
chmod u+x .bash_history
chmod g+rx .bash_history
chmod o+rx .bash_history

It may seem a little daunting at first but after a little practice it becomes very easy. You can also change permissions on directories and files recursively using the "-R" option.

There are some special modes, these are just the basic. You can also set the "SETGID" and "SETUID" bits and some others. Do a search on google for "UNIX file permissions" and you should find plenty of info explaining it. I may not have done a very good job of explaining it...

[EDIT] The .bash_history file was probably an EXTREMELY bad example for this, please do not set this file to be executable and especially PLEASE do not execute it if you did. Pick another file. Unless of course you want every command you ever issued to be reissued.  

[ June 09, 2002: Message edited by: VoidMain ]

Calum:
the unleashed books are fantastic. all three versions of 'unix unleashed' should keep you engrossed for months, search using google, as they are all fully available as html pages online. I recommend the system administrators edition.  :D

ravuya:
I've found UNIX in a Nutshell, by O'Reilly, to be really, really good. It covers SVR4 and Solaris 7, but the commands are generally the same across most Unix-like systems including Linux.

As for the kernel, I'm not sure, Understanding The Linux Kernel might help, but I've never read it.

Master of Reality:
the manual pages are a lot of help when dealing with a command that you dont quite understand. just do: 'man "command"'

Navigation

[0] Message Index

[#] Next page

Go to full version