LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need Help With /proc Please! (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-with-proc-please-447599/)

dezrik 05-23-2006 03:24 AM

Need Help With /proc Please!
 
Guys, I am having a bit of a trouble with working out what this means:

The following listing shows the content of the “fd” folder:
lrwx------ 1 john john 64 Apr 21 16:37 0 -> /dev/tty1
l-wx------ 1 john john 64 Apr 21 16:37 1 -> /dev/tty1
lrwx------ 1 john john 64 Apr 21 16:37 2 -> /dev/tty1

Guys, I can't work out what the 0, 1, and 2 (0 -> /dev/tty1) represent... could anyone help me out? I need it for my studies.

Also, if I ran a command like /usr/bin/myBinary > /home/john/output”, what would that do? I'm new to /proc and am kinda swamped! Thanks guys.

Well that was a great n00b post, thanks Linux Masters.

Tinkster 05-23-2006 03:38 AM

Hi, and welcome to LQ!

Quote:

Originally Posted by dezrik
Guys, I am having a bit of a trouble with working out what this means:

The following listing shows the content of the “fd” folder:
lrwx------ 1 john john 64 Apr 21 16:37 0 -> /dev/tty1
l-wx------ 1 john john 64 Apr 21 16:37 1 -> /dev/tty1
lrwx------ 1 john john 64 Apr 21 16:37 2 -> /dev/tty1

Guys, I can't work out what the 0, 1, and 2 (0 -> /dev/tty1) represent... could anyone help me out? I need it for my studies.

In that case you should probably ask your teacher?


Quote:

Originally Posted by dezrik
Also, if I ran a command like /usr/bin/myBinary > /home/john/output”, what would that do? I'm new to /proc and am kinda swamped! Thanks guys.

Well that was a great n00b post, thanks Linux Masters.

Read
man bash
/^REDIR

And we don't do homework questions here ... ;} .... read the
rules you agreed to again, please.


Cheers,
Tink

dezrik 05-23-2006 03:54 AM

Sorry mate, it's not for homework or anything, it's a combination of an old assignment question I never answered and something I am trying to do myself for my linux boxes I've been setting up (and need a better understanding of /proc to do correctly!)

(By studies I meant studies I am undertaking myself to expand on what I have learnt previously.)

I'm just intrigued to find out what it actually means, particularly the numbers as I can't find reference to them anywhere (the numbers at the end of the statment that is.) So if anyone would be kind enough to tell me what those numbers are so I'm not left staring at my little linux box on the floor trying to decipher what they are for the next three hours I'd be forever greatful!

syg00 05-23-2006 04:02 AM

"man proc" - it's basically stdin, stdout, stderr.

Tinkster 05-23-2006 04:03 AM

Quote:

Originally Posted by dezrik
Sorry mate, it's not for homework or anything, it's a combination of an old assignment question I never answered and something I am trying to do myself for my linux boxes I've been setting up (and need a better understanding of /proc to do correctly!)

(By studies I meant studies I am undertaking myself to expand on what I have learnt previously.)

I see. In that case :}

Code:

lrwx------ 1 john john 64 Apr 21 16:37 0 -> /dev/tty1
 l-wx------ 1 john john 64 Apr 21 16:37 1 -> /dev/tty1
 lrwx------ 1 john john 64 Apr 21 16:37 2 -> /dev/tty1

0 is STDIN
1 is STDOUT
2 is STDERR

Basically those fd entries you find under the varied PIDs
in proc tell you what the process is using as a FileDescriptor
for the three things mentioned above.

man 5 proc
/fd
for details ... :}



Cheers,
Tink

dezrik 05-23-2006 04:36 AM

Thanks a bunch guys... Linux has never been my strong suite, hence why I'm trying to beef up on it!


All times are GMT -5. The time now is 11:53 AM.