Author Topic: i need book which explains mix of the kernel and commands  (Read 840 times)

Chooco

  • Member
  • **
  • Posts: 318
  • Kudos: 0
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

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
i need book which explains mix of the kernel and commands
« Reply #1 on: 9 June 2002, 19:03 »
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: [Select]

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 ]

Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
i need book which explains mix of the kernel and commands
« Reply #2 on: 9 June 2002, 20:32 »
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
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

ravuya

  • VIP
  • Member
  • ***
  • Posts: 517
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #3 on: 9 June 2002, 20:43 »
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

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
i need book which explains mix of the kernel and commands
« Reply #4 on: 9 June 2002, 21:11 »
the manual pages are a lot of help when dealing with a command that you dont quite understand. just do: 'man "command"'
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

ahri

  • Member
  • **
  • Posts: 50
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #5 on: 10 June 2002, 02:47 »
If you don't mind online tutorials, there are a bunch at IMB's linux "zone".  http://www-106.ibm.com/developerworks/linux/?loc=dwmain

the beginner ones are here http://www-105.ibm.com.......OpenDocument
they might be too basic, but they prep. you for some kind of certification exam. You have to register to read the tutorials, but its free.

I don't like how they did the tutorials though. There is only a couple sentences per page, and you have to keep clicking "next" links to get the rest. I prefere books too.

[ June 10, 2002: Message edited by: Calum ]


Chooco

  • Member
  • **
  • Posts: 318
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #6 on: 10 June 2002, 05:29 »
so Unix in a nutshell huh? thanks for all the commands there too man    i finaly understand a bit of how chmod works  ;)

slave

  • Member
  • **
  • Posts: 1,136
  • Kudos: 0
    • http://www.fuckmicrosoft.com
i need book which explains mix of the kernel and commands
« Reply #7 on: 10 June 2002, 05:51 »
I have Red Hat Linux 7.2 Unleashed, and have found it quite useful in navigating through the complex and often mysterious configs in Linux.

dbl221

  • Member
  • **
  • Posts: 253
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #8 on: 11 June 2002, 00:42 »
The official Computer Systems Unix Book list:

Running Linux--O'Reilly
Programming Perl--OI'Reilly
Understanding the Linux Kernel--O'Reilly
Learning the bash shell--O'Reilly

These are a few of the books we use at my college.
Good Luck
dbl221***Comp-Sys walking wounded

Chooco

  • Member
  • **
  • Posts: 318
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #9 on: 12 June 2002, 11:36 »
why would you program Perl? isn't PHP superior or something? i just got the book Linux In A Nutshell...AWESOME BOOK! has over 100 pages of straight commands and all parameters and what they do! also helps explain some bash things. i'll have to get one of those "avid read" cards from Chapters so i save 10% on these eheheh, using my friend's right now and i've saved over 40 bucks  

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
i need book which explains mix of the kernel and commands
« Reply #10 on: 12 June 2002, 21:12 »
Perl is a VERY worthwhile language to use. It is very portable, very powerful and very easy to learn.  No one language is the best at everything. I use both PHP and Perl. I use PHP mostly for web database programming and I use Perl for system scripting when more than just shell scripts are needed.  They each have their strengths. I would suggest learning both PHP and Perl and you decide where it makes the most sense to use each. And there are a TON of Perl modules out there.
Someone please remove this account. Thanks...

Chooco

  • Member
  • **
  • Posts: 318
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #11 on: 13 June 2002, 04:56 »
dude i can't get Perl to work on Linux. my windows computer can use perl easily but Linux hates it. it keeps saying Internal Server Error, the cgi-bin is ALL chmod 755 and the Apache config has the same lines in it as the Apache config on my windows computer (i changed the directories though, C:/perl/perl.exe is now /usr/bin/perl and so on) but it's still fudged. why does Linux make it so god damn hard to run anything? i asked at least 4 different forums how to install this and they are all completely stumped as to wtf is wrong.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
i need book which explains mix of the kernel and commands
« Reply #12 on: 13 June 2002, 07:32 »
Dude, try putting this line at the start of your script (so it produces the first line of output):

Code: [Select]

This will fix your problem if you are getting this message in your error log:

Code: [Select]

I personally find it MUCH easier to do web programming in Linux than on M$ systems. If the above doesn't fix your problem I will help you until we have your issue resolved.  I assume you also know not to write your script on a Winblows box using notepad and then transfer it to the Linux box. Or if you do make sure you strip the carriage returns either by using FTP transfers in ASCII mode or do:

tr -d '\r' < yourscript.cgi > yournewscript.cgi

And I also assume that you know to make sure the script runs on the command line before trying to debug it through Apache..

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

Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
i need book which explains mix of the kernel and commands
« Reply #13 on: 13 June 2002, 21:54 »
Chooco, did my suggestion work for you?
Someone please remove this account. Thanks...

dbl221

  • Member
  • **
  • Posts: 253
  • Kudos: 0
i need book which explains mix of the kernel and commands
« Reply #14 on: 14 June 2002, 22:19 »
Perl is fantastic as Void said.  There is sooo many modules out there for perl on Linux that it is just mindblowing.  PHP...no time for that yet.  Perl is far better that shell scripting but for simple things bash snd company are fine.

Ruby is cool...try it...nice clean code.
dbl221***Comp-Sys walking wounded