Originally posted by: pitupepito2000
As I am reading a linux book, a lot of questions arose, and I figured I should post them here so the knowledgeable gurus could answer it, and other could benefit from the answes. So here I go:
1. What is the difference between line feed and return?
Not sure what you mean. A line return is a \n symbol at the end of lines that the console/text editor/word proccessor interprets as a end of a line. I think DOS/Windows uses a \r\n and MacOS can use either. Sometimes you need to translate text files from one format to another.
2. can there be more than one filesystem per partition?
What do you mean? Like running Ext3 and XFS at the same time on the same partition?
Well then no you can't.
3. what are the init, inittab, and rc files?
They are parts of the start up scripts for Linux. Most Linux distros use what is called System-V init scripts.
Init is the first program that is started by the kernel. Each program has a parent-child relationship. Say you open a xterm, and you use that Xterm to open Mozilla. Well then Xterm would be the parent and Mozilla is the child.
init is the parent of ALL the proccesses. Those scripts tell init when and how to start what program in order to get your OS started. They are BASH scripts in Linux and you can see them and edit them to suit you, but most of the time it's easier to let the OS manage them. There is usually a rc.local or whatnot that you can stick in your own scripts and commands so that you don't have to go thru all the effort of following the startup script conventions.
To see the parent child relationships do a "ps -AH" (probably only works with the GNU's version of ps). You'll see that Init is "0" Which is the first number this signifies that it is the very first program to start.
4. are tape drives everg going to come back?
They never realy went anywere. I use tape drives everyday (cause I am a tape monkey). But it's hard when you can get 100gig harddrive for less then a hundred bucks.
So unless somebody does some serious technological breakthru (like create cheap optical tape or something) tapes are going to become more and more rare.
Price is not on their side. The main advantage of tapes is that they have ABSOLUTELY MASSIVE amounts of aviable surface area compared to size.
5. do vitural consoles (alt-f1) only work with eht left alt key of the keyboard?
Don't know. Something to do with the keymap.
6. does ls treat files different than directories?
Yes. To me ls is a bit brain-dead, but people ared use to it. If you do a general "ls" it will show directories the same way as files. Maybe a different color if you have them enabled.
If you do a "ls filename" it will show that filename, if you do "ls directory" it will show the contents of that directory.
To make it treat directories like files you do a "ls -d directory".
7. what is the .Xdefaults and what does it do?
Stores the defaults configs of different X apps. Kinda obsolete I guess.
8. why does linux create a new group everytime you create a new user?
Because that's the default behavior of your adduser script or gui program. All my users belong to the users group.
9. what is the real technical definition for a simbolic link? In other words, how do they work?
File themselves are nothing but a bunch of ones and zeros on the harddisk. Directories are files, too, but they are special because they contain information called metadata that is information about information. Like filenames, pointers, permissions, etc etc.
For instance if you have a hiccup like a power surge or blackout and one of the directories get corrupted or dissapeers, then all the filenames and information about the files that it contained will be gone. However the fsck may recover the actual file, but the filename and permission information will be gone.
The directories contain "Links" that point out to the OS the location and sizes of the actual file on the physical harddrive.
A hard link is that pointer and is use to allow the file to be abstractly represented when you navigate the directories.
A file can have many pointers, but only NEED one. A hard link creates a real tangable representation of that file to the filesystem. You delete the hard link, you delete the file. You can have several hard links, but they can only be on the same partition of that actual file.
For instance you can "move" files. The mv command will create a new hard link, check it, and then delete the original hard link and "move" it to another directory (without ever touching the original file or moving any bits around). But if your moving from partition to partition "mv" then has to copy the information from one partition to another and then create the hard link for the new copy of the file and then delete the old hardlink for the original file, thus "deleting" the original file. That's why mv's within a filesystem is super-fast, but from partition to partition it takes much more time.
A symbolic link is a a pretend hard link. It creates a simple file that redirects the attention of the OS to the actual file everytime you access it. You delete the symbolic link, the original file is unmolested.
10. what shell of the many that are available would be a good idea to get familiar with and why?
I like BASH.
11. what does POSIX-compliant mean?
It's a set of standards for operating systems. Mostly Unix stuff, the higher level 2 OSes are in Posix compliance then the easier it would be to port applications from one OS to the other.
There are different POSIX standards and they change over time and they cost money to look at. Linux is semi/mostly-Posix compliant.
12. what is the difference between tcsh and csh?
not to sure. I think they created one to replace the other due to liscencing/legal issues
13. how does proc work? I know what it is, but how do the internals and guts of it work?
it's information is populated by the kernel. I don't know the technicalities of it, but it's a "pretend" file system.
I unix everything is files, They aren't REAL files in /dev and /proc like that are stored in the home directory, but by creating this abstract version of files and directories it makes it easier for people to deal with it and programs to be made to handle it.
Basicly you don't need to understand how it works to use it, that's what /dev files and /proc information is about.
The information that is their is a bit hodge-podge. It just sort of evolved over time and whatever people thought was important they just found a place in the /proc directory to stick it.
Another new one for kernel 2.6 is sysfs found in the /sys directory. (you can make it and mount it if it doesn't exist by default and your using 2.6). It's a attempt to create a coherent way to show kernel information/controls as files. Also possible replacement for /dev file system.
Thanks for answering the questions,
pitupepito.
I try. But if your curious google and vivisimo is your friend. Plenty of times I am dead wrong about a lot of stuff.