Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Learn How UNIX Multitasks

Posted by CmdrTaco on Mon Apr 09, 2007 10:49 AM
from the i-can't-even-unitask-this-morning dept.
BlueVoodoo writes "On UNIX systems, each system and end-user task is contained within a process. Learn how to control processes and use a number of commands to peer into your system."
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • exciting (Score:5, Funny)

    by Anonymous Coward on Monday April 09 2007, @10:54AM (#18663973)
    Wow! ps, top, sleep, kill, PIDs? This is some pretty groundbreaking stuff here!
    • Re:exciting (Score:5, Interesting)

      by Anonymous Coward on Monday April 09 2007, @11:03AM (#18664117)
      Don't forget to set the I_WANT_A_BROKEN_PS [rt.com] environment variable!
    • Re: (Score:2, Funny)

      Now, that wasn't very nice.
    • I especially liked this one:

      $ ls -l /usr/bin/top
      -r-xr-sr-x 1 root tty 19388 Mar 20 2005 /usr/bin/wall

      Wow. That's a neat trick.
        • I thought the setgid bit on the executable causes it to run with 'tty' as its gid; which presumably gives it the privilige to write to the various tty devices under /dev.
            • Re:exciting (Score:4, Informative)

              by cortana (588495) <sam@roTEAbots.org.uk minus caffeine> on Monday April 09 2007, @02:21PM (#18666839) Homepage
              Bear in mind that the various devices may do different things on different operating systems.

              On Linux, /dev/tty refers to the controlling terminal of the process that opened it. Therefore there is no reason to restrict its permissions... in fact to do so would prevent processes from writing to the terminal (if they wanted to do so directly to read a password, for instance, rather than relying on reading from stdin). /dev/tty[0-9]+ are the actual virtual consoles that one logs in on. They are owned by root:root until someone logs in on one whereupon they become owned by $user:tty. /dev/pts/[0-9]+ are pseudo terminals that are created by a terminal emulator such as xterm, or a remote login server such as ssh. They are also owned by $user:tty

        • by bberens (965711) on Monday April 09 2007, @12:22PM (#18665197)

          Switch your shell to one with auto-completion and go through each letter of the alphabet, hitting tab after each one and then viewing the manual page for each command you don't already know.

          How about: Bathe, get a girlfriend, go outside, read a 20 minute FAQ and learn more than most *nix sysadmins seem to know.
        • Re: (Score:2, Interesting)

          I used to run "w" and see what other people were doing, then look at the man page for that.
  • Next... (Score:5, Funny)

    by ari_j (90255) on Monday April 09 2007, @10:55AM (#18663989)
    Learn how UNIX stores files. This revolutionary new article will show you how to use ls and cd, and you will walk away with a complete understanding of how files are stored. More magic demystified, indeed!
  • by Anonymous Coward on Monday April 09 2007, @10:58AM (#18664037)
    I get
    "ps: Command not found"

    What do to? Heeeeeelp.
  • Incredible! (Score:5, Funny)

    by Wuhao (471511) * on Monday April 09 2007, @11:00AM (#18664049)
    With several businesses now owning their own Unix mainframes, and with some futurists speculating that hobbyists may one day have full-fledged Unix systems in their basements, a detailed understanding of Unix operation -- including its intricacies, like these "processes" -- becomes increasingly important, even for people not charged with the operation of one of these computational goliaths. I for one plan to study these "processes" carefully.
      • Re: (Score:3, Funny)

        I envision there one day being a vast network of computers, accessible to all, containing limitless mountains of data -- and on this network, the common man will finally be able to communicate with his kinsmen worldwide and transcend all borders. Finally, free of the tyranny of governments and liberated from the logistics of contemporary communication, Mankind shall at last realize his full artistic potential. No more need a man hide his drawings of the horribly mutated, furry Mr. Spock and Captain Kirk eng
  • Use the Firehose! (Score:5, Insightful)

    by 644bd346996 (1012333) on Monday April 09 2007, @11:03AM (#18664113)
    If you think this article is stupid and an insult to your technical prowess, go to the firehose and vote it down.
    • by gEvil (beta) (945888) on Monday April 09 2007, @11:09AM (#18664193)
      Mod Parent Up! Vote Article Down!
    • Hey, there are editors that (hopefully) get money to do something.
      Maybe they should start?
    • Re:Use the Firehose! (Score:4, Interesting)

      by jellomizer (103300) * on Monday April 09 2007, @11:57AM (#18664911)
      Yea you are a big man now. You read an article and you understood it before you read the article. So you feel inclined to instult the fact that some people may not know this.
      Yes this is Basic Unix Command Line suff. But a lot of Unix users don't go beyond typing the command to run the program. Forking, Piping, Scripting, is more then what they really use. An some of the times these people who don't understand this are actually smarter then most of us. Say a Physicist who uses Unix to test their math or run complex simulations. Also there are a lot of people using Linux/Unix who were never formally taught how to use it. So they stick in the GUI, or Find and install programs that a simple small script can acomplish. I know you want to do your "I am an Alpha Geek" while thumping your chest. But if an article gets posted and you really don't care, then don't read it and move along. Because getting an article on information that you already know isn't a big deal, this is far more mature then say the latest Cool PC Mods.
      • Yeah, but should we really have basic articles like that on this site? Maybe we should have an algebra primer? 2x+4=12, show me how to solve for x. Or using your physicist example, should we have an article describing the coefficient of friction for us? No, because it doesn't really fit with the site.

        Nobody's saying that the article isn't useful, but it's not a /. article.
    • by Vellmont (569020) on Monday April 09 2007, @12:14PM (#18665097)

      If you think this article is stupid and an insult to your technical prowess, go to the firehose and vote it down.

      Not everyone on Slashdot is at the same level as everyone else. While I've known all the stuff in the article for 10-12 years, I'm certain there's a significant number of people here that have no idea about process forking, or what the init process is.
  • random? (Score:5, Funny)

    by flynt (248848) on Monday April 09 2007, @11:04AM (#18664127)
    Is it just me, or is this one of the most random Slashdot articles ever posted? A link to Chapter 8 of an IBM manual on Unix development, really?
  • Gee Whizzes (Score:5, Insightful)

    by helixcode123 (514493) on Monday April 09 2007, @11:11AM (#18664231) Homepage Journal
    I have mod points, but I thought I'd post instead: Look genuises. Not every slashdot reader is a Unix guru. I think this is an excellent article and does a great job explaining some of the core workings of Unix/Linux. I've been fortunate enough to be using Unix since 1981 and I actually enjoyed reading the article. It offers our Windows-centric Slashdot breatheren a nice overview.
    • It offers our Windows-centric Slashdot breatheren a nice overview.
      I agree. I know I've always wanted to explain the concept of SIGSEGV to Microsoft's development group.
    • Re:Gee Whizzes (Score:4, Insightful)

      by squiggleslash (241428) on Monday April 09 2007, @12:44PM (#18665525) Homepage Journal

      While there will always be space for newcomers, there's a standard underneath it becomes somewhat pointless and adds needlessly to the signal to junk/noise ratio to consider adding an article. A newcomer's guide to Unix is one thing, but a brief overview of a small part of the system which will be useless to the majority of Slashdot readers, and will be too lacking in context for newcomers, fits well below that standard.

    • by loconet (415875) on Monday April 09 2007, @12:59PM (#18665715) Homepage
      It offers our Windows-centric Slashdot breatheren a nice overview

      John and Mark don't have net access on Mondays so they wouldn't have been able to read this article anyways.
  • Digg? (Score:5, Funny)

    by loconet (415875) on Monday April 09 2007, @11:13AM (#18664255) Homepage
    Did I mistype the URL? No, it does say slashdot.org. Odd... I should go back to bed.
  • I like the pretty colors they use in their pictures, and the fun wavy lines. Oh! And they didn't color them in! But the SO hates when I get crayon on the monitor... What to do!
  • by guruevi (827432) <evi&smokingcube,be> on Monday April 09 2007, @11:27AM (#18664457) Homepage
    Really, the article is great in explaining your manager how Unix processes work. It's a down-to-earth introductory explanation of processes and has some interesting information (which we all know, because we're all POSIX guru's) for newbie's and junior sysadmins switching to Linux/Unix/AIX
  • And TFA does not even include a link to one of the most important process viewing programs around - lavaps - which shows processes running on your system in a lava-lamp-esque display.

    While the article is a bit elementary for most unix users, there are those who are not unix users who might need someday to know this.

  • by Ikcor (676683) on Monday April 09 2007, @11:43AM (#18664727)
    How to master the "other half" of the keyboard using the newly discovered SHIFT key.
  • Segfaults (Score:5, Funny)

    by Anonymous Coward on Monday April 09 2007, @11:47AM (#18664771)

    If it helps, you can think of a process as its own sovereign nation, with borders, resources, and gross domestic product.
    Does this mean that illegal immigrants are responsible for my processes segfaulting?

      • Re: (Score:2, Funny)

        by Anonymous Coward
        This is the traditional method. However, the new school of thinking is to use the "wall" program to limit access. E.g.,:

        [gwb@usa] wall
        Stay out, all of you!
        ^D

        Message from gwb@usa:
        Stay out, all of you!

        On a side note, the new school of thinking works great with typical hack attempts. For example, if a user from systema (afgst) launches a remote exploit attempt, the new school suggests that you launch an attack against systemIRQ (interrupt request, for example). SystemIRQ has nothing to do with the attack,
  • I tried this program:

    int main()
    {
        while(1) fork();
    }

    but nothing happens?

  • by Morky (577776) on Monday April 09 2007, @12:33PM (#18665375)
    Doesn't SCO own the rights to this information?
  • by Tyr_7BE (461429) on Monday April 09 2007, @01:12PM (#18665881)
    I saw slashdot transformed into Digg, with "slashdotit" links everywhere. That was supposed to be a joke, right? Because it's only funny the first time.
  • slownewsday tag (Score:3, Interesting)

    by superdude72 (322167) on Monday April 09 2007, @04:26PM (#18668127)
    The existence of tags like "duh" and "slownewsday" creates a perverse incentive to approve articles like these.
    • Sadly though, there are probably people graduating from "computer science" programs who only know of 'processes' as something you get after pressing Ctrl-Alt-Del and clicking on the "Task Manager" button.

      You're vastly overestimating the CS curriculum, at least at my local State uni, if you think that UNIX anything is taught in the 100-level courses.
      • Re: (Score:2, Insightful)

        That may all be true, but you don't graduate with just the 100-level courses!
      • by loconet (415875) on Monday April 09 2007, @01:10PM (#18665855) Homepage
        I think one of the big problems is not so much the lack of content offered in the classroom. The bigger problem I see IMHO is the lack of interest from students as a result of a poor introduction into what UNIX really is and how it will come to play in their careers (ie: beyond their gaming desktop).

        I have recently gone back to school to finish up my CS degree after having worked in the industry for several years and I'm surprised at the ignorance of UNIX/Linux's usefulness from people who have already taken a UNIX/Linux course in my school. It seems profs are jumping straight into bash scripting without properly introducing what UNIX really is, what the difference between UNIX and Linux is, how it is used today, why it is important to learn it, how it is different than Windows, the philosophy behind UNIX, how it is useful as a tool, etc. All students are being exposed to is a command line and some scripting. No context in the technology whatsoever. It is then not surprising that students come out of those courses thinking UNIX and Linux are useless since Windows/Macs do it better, easier. This results in them erasing whatever little knowledge they acquired as soon as exams are done with.
    • by NeoPaladin394 (1044484) on Monday April 09 2007, @11:27AM (#18664455)
      This is an article in a series (labeled Introductory to Intermediate) designed to introduce to the O/S. The first article in the series [ibm.com] talks about how to use find! You can't point at an O'Reilly book and call Stupid because you know what it talks about. The article is well written and explains processes perfectly for the intended audience, and not everyone is born with the intrinsic knowledge of how every O/S in the world works. Readers on this site want a world of O/S choices, but are so willing to bash an article that will help accomplish just that? And just because it gives a quick, sentence overview of PS and LS? Unbelievable.

      The article may or may not belong on the front page, but claiming someone's illiterate for not knowing stuff like this, especially if they were in an Apple or MS shop? Heaven forbid.

      • The article may or may not belong on the front page, but claiming someone's illiterate for not knowing stuff like this, especially if they were in an Apple or MS shop? Heaven forbid

        Um, I don't care if they are in a DOS/Novell shop. This is basic stuff and are also concepts that have relevance in all OSes.

        As for Apple or MS shop? Ok, Apple uses a BSD interface to a Mach kernel and is very much a *nix architecture. In the MS Shop, NT also includes a full BSD subsystem that is used for running *nix applicait
          • Re: (Score:3, Interesting)

            Ok, agree with one exception.

            If you hire someone who is supposed to be working with Windows/*NIX interoperability and hadn't a clue how UNIX works, then you have a problem and, yes, the new guy is illiterate for the task he is given. If you hire a developer to make a .NET application for a specific Windows architecture, then I wouldn't consider the user illiterate for not knowing the processes and binary code Unix launches on startup. At least, not in the incompetent sense that the word is being used here.


            I
    • Re: (Score:3, Insightful)

      It's called "here's a slashdotting to boost my pagerank". Whenever you see useless tripe on the internet, chances are it's designed to generate idiot traffic and/or ad revenue. Thank Google for this glut.
    • Re:Woop-tee-doo. (Score:5, Insightful)

      by ukemike (956477) on Monday April 09 2007, @01:31PM (#18666185) Homepage

      It's a basic primer on UNIX job control. Whee. Not that it isn't well done or useful to the target audience -- but how is this 'news', never mind 'stuff that matters'?

      "Looks like someone has a case of the mondays!"

      I thought that the slashdot community was supportive of people migrating away from windoze to the linux world. TFA covers things that are not obvious to people that don't have *nix experience. It was a nicely written article. It might spur discussion on further basic knowledge needed to deal with linux. The whole community of "nerds" includes slide-rules to slashdot. Not every nerd is a sysadmin. To me this was useful. I already had learned 75% but had forgotten some and a bit was new and might be handy. That is "stuff that matters" to me. If nothing else cranky sysadmins, when posed with a question about something this basic, could roll their eyes condescendingly and give a link to this handy page.

      The better question is why is this posted under "devcelopers"?