LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2006, 12:47 AM   #1
butters88
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
Question Six Basic Linux Questions from a Newbie


Hey everyone, I'm really new to Linux and I just had a few really basic general questions to ask. I'm sorry if these questions are answered somewhere else but I couldn't find them. If you could point me to a good site for these sorts of questions then I'd appreciate that too.

1) What is a regular file on a Linux system? What sorts of regular files can exist and what values can the bytes within each have?

2) On Windows, most of the time when you install an application all its relevant files go in the same directory (ie. under Program Files\whatever), how is this different in Linux?

3) In addition to the normal permission bits of a node (rwxrwxrwx) what is the 10th bit for and how is it special? What uses does the special bit have?

4) What does having write access allow you to do compared with write access on individual files? Does it give you write permissions on all files within? Or just the permissions to create new files?

5) What is an inode? What does it do? Are all the blocks which comprise an inode necessarily in the same physical location?

6) Is it possible to hardlink directories in Linux? Why/why not?

Thanks in advance, I know these are really stupid/simple questions, and I appreciate any answers you can give.

Last edited by butters88; 05-02-2006 at 01:00 AM.
 
Old 05-02-2006, 01:45 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Looks like homework to me.....

What distribution are you using? Do you have it up and running? Any issues?
 
Old 05-02-2006, 01:57 AM   #3
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18
1) On Linux, everyhting is a file. Seriously even devices are files.

2) The executables are kept in /bin, /usr/bin, /local/bin, /usr/local/bin, /sbin, /usr/sbin
and probably more. I can't think of any right now. That might seem like over kill, but it is actually very well organized. I don't want to go into detail, but most of them will be stored in /usr/bin or /usr/local/bin. There will rarely (if ever) be a need for you to locate an executable.

3) The first bit specifies the file type.'-' is ordinary, 'd' is directory, 'l' is link.

4) When set for a directory, this permission grants the ability to modify its tree. This includes creating files, changing their permissions, and deleting files.

5) http://en.wikipedia.org/wiki/Inode

6) Yes... because it's convenient.
 
Old 05-02-2006, 02:01 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by butters88
Hey everyone, I'm really new to Linux and I just had a few really basic general questions to ask. I'm sorry if these questions are answered somewhere else but I couldn't find them. If you could point me to a good site for these sorts of questions then I'd appreciate that too.
http://www.linuxvirgins.com/

Quote:
1) What is a regular file on a Linux system? What sorts of regular files can exist and what values can the bytes within each have?
A regular file is any which has no special role in the operating system. So it isn't, for eg, a directory, a link, or a block special device. Text files are regular files. The bytes inside each file can have any value from 0 to 256.

Quote:
2) On Windows, most of the time when you install an application all its relevant files go in the same directory (ie. under Program Files\whatever), how is this different in Linux?
In linux, it is usual for only the files directly concerned with only the program in question are in the same place. There are many shared programs and libraries, used by many applications, which will not be in the same directory at all. Shared stuff often ends up in /usr/share. System executables will end up in /sbin and user executables are often in /usr/bin ... but not always. This modular approach means you seldom get multiple instances of a sub-program installed simultaniously.

Quote:
3) In addition to the normal permission bits of a node (rwxrwxrwx) what is the 10th bit for and how is it special? What uses does the special bit have?
The tenth bit is at the beginning and specifies the file type. - is a regular file, d is a directory etc. See the chmod man page for details.

Quote:
4) What does having write access allow you to do compared with write access on individual files? Does it give you write permissions on all files within? Or just the permissions to create new files?
You mean, write access to what? A file system mounted rw will confer read/write access to all files therein. (see the chmod man page)

Quote:
5) What is an inode? What does it do? Are all the blocks which comprise an inode necessarily in the same physical location?
http://www.google.co.nz/search?hl=en...ition&ct=title
http://dict.die.net/inode/

Quote:
6) Is it possible to hardlink directories in Linux? Why/why not?
Yes. See the ln manpage for details.

Quote:
Thanks in advance, I know these are really stupid/simple questions, and I appreciate any answers you can give.
Most of what you want to know is on the web already. Google is your freind. But at least you are trying to understand.

If you have a question about what something is or means, type "definition <thing>" in the google searchbar. The definition will give you more search terms to the exact info you need.

questions about something associated with a command can usually be investigated through the linux man pages. Open a terminal and type "man <thing>" or "info <think>" to learn more.

Welcome to the community.

Last edited by Simon Bridge; 05-02-2006 at 02:05 AM.
 
Old 05-02-2006, 02:54 AM   #5
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Honolulu, HI
Distribution: Arch
Posts: 1,380

Rep: Reputation: 47
Sounds like homework to me
 
Old 05-02-2006, 03:26 AM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Ah... you mean we're being suckered!
Well we'll just traceroute the sucker and ... and ... tell on him! Waaah!

(You're only young once, but you can be immature for your whole life.)
 
Old 05-02-2006, 04:58 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by Simon Bridge
The bytes inside each file can have any value from 0 to 256.
0 to 255 maybe
 
Old 05-02-2006, 05:06 AM   #8
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Hmm, this does sound kinda like homework, but anyway...

Quote:
4) What does having write access allow you to do compared with write access on individual files? Does it give you write permissions on all files within? Or just the permissions to create new files?
I assume you mean write access to a directory? This gives you permission to "modify" the directory, i.e. create/delete files in it. But you cannot modify the files themselves unless you have write permission to those files. So if root creates a file in your home directory with 600 permissions, you can delete the file, but you can't edit it.

Quote:
Quote:
6) Is it possible to hardlink directories in Linux? Why/why not?
No, you cannot hard link directories. This would allow the creation of loops, which would screw up any program which accessed the filesystem (ls, fsck etc). The directory tree must be one-way, top to bottom. For example, if you had a directory /var/hardlink, which was hardlinked back to /var, then ls -R /var would get stuck in an infinite loop.
 
Old 05-02-2006, 05:39 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by Wim Sturkenboom
0 to 255 maybe
Yeah - I know of another mistake in my post ... can you spot it?
 
Old 05-02-2006, 05:56 AM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You didn't mention what manpage to look at for starters (hardlink question)
 
Old 05-02-2006, 06:12 AM   #11
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Quote:
You didn't mention what manpage to look at for starters (hardlink question)
I told you already, you can't hard link directories.
 
Old 05-02-2006, 06:17 AM   #12
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
From the man page for ln:

Quote:
GNU OPTIONS
-d, -F, --directory
Allow the super-user to make hard links to directories.
But this is irrelevant.

Quote:
# su
...
# ln . foo
ln: `.': hard link not allowed for directory
Above error message is printed by ln.
Quote:
# ln -d . foo
ln: creating hard link `foo' to `.': Operation not permitted
Error message printed by the kernel, ln tries to make the link but the kernel won't allow it.

Quote:
# strace ln -d . foo
...
lstat64(".", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0
lstat64("foo", 0xbfffe870) = -1 ENOENT (No such file or directory)
lstat64("foo", 0xbfffe870) = -1 ENOENT (No such file or directory)
link(".", "foo") = -1 EPERM (Operation not permitted)
...

Last edited by ioerror; 05-02-2006 at 06:20 AM.
 
Old 05-02-2006, 06:43 AM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I was just responding to Simon's post ioerror
 
Old 05-02-2006, 06:55 AM   #14
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Quote:
I was just responding to Simon's post ioerror
OK, just checking, half the time people seem to ignore me .

Anyway, my above post shows that you cannot create hard links to directories. I believe that it was possible with ye olde unix (V6,V7 etc), but since it causes huge problems, it is now disallowed by the kernel (well, Linux at least, I assume all modern kernels are the same but I'm not sure).

Last edited by ioerror; 05-02-2006 at 06:58 AM.
 
Old 05-02-2006, 07:18 AM   #15
butters88
LQ Newbie
 
Registered: May 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Well I'm studying Linux at university and I've been using Fedora Core 4 on the lab computers. I haven't been able to set it up at home yet (so I don't know about compiling my own kernels or anything like that yet). Anyways I've just been learning the commands and I'm not very familiar with the workings of the OS, that's why I had several questions and thought this would be the best place to ask.

In regards to question 4, I meant does having write permissions on a directory give you write permissions on all files within as well as giving you permissions to create new files in the directory??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
3 Basic Questions From a Newbie - installation locations, working with icons, etc lakshre Linux - Software 4 11-27-2005 04:34 PM
Please answer some basic questions froma daft newbie jmpm Linux - Newbie 7 01-06-2004 07:49 AM
Just a couple Newbie Questions(BASIC KELP) dbarrington Linux - General 7 11-22-2003 02:16 AM
Some Basic Hardware and Software Questions from a Newbie shodekiagari Linux - Newbie 9 11-09-2003 09:50 PM
Newbie Basic linux questions??? rondog Linux - Newbie 1 08-21-2001 08:55 AM


All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration