Find the answer to your Linux question:
Results 1 to 9 of 9
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [SOLVED] how to run two background process


    hi friends i have ported linux into arm and i want to run two background process on target

    i have two c programs a.c and b.c
    i have cross compiled them as

    arm-linux-gcc -o a a.c
    arm-linux-gcc -o b b.c

    now i have transfered both object file a and b on arm
    but i dont know how two run two background process
    i want to run both the process at same time,,,,,

    plz help me how can i run this

  2. #2
    You can start the process and push them to backgroud with bg command.

  3. #3
    If I wanna start a program in the background I simply add a & at the end.
    ./a &
    ./b &
    should do is.

  4. $spacer_open
    $spacer_close
  5. #4
    Quote Originally Posted by praveenkv1988 View Post
    You can start the process and push them to backgroud with bg command.
    directly typing bg over a running process wont do anything, rather issue a CTRL-z (to stop it, SIGSTOP) and then type bg to run it in back ground.
    BTW, fg will again push is to foreground.

  6. #5
    A little better method is using the nohup as well (stands for no hangup after logout, so when your shell ends, it keeps on running)
    So:
    # nohup ./a &
    # nohup ./b &

    Nohup will also redirect all stdout to go in the textfile nohup.out.

  7. #6
    Just Joined!
    Join Date
    Apr 2005
    Location
    Central Florida
    Posts
    12
    check man pushd and popd just stack them up.

  8. #7
    Quote Originally Posted by genomega View Post
    check man pushd and popd just stack them up.
    pushd and popd are commands for managing your shell's directory stack.

    pushd and popd - Wikipedia, the free encyclopedia

  9. #8
    Just Joined!
    Join Date
    Apr 2005
    Location
    Central Florida
    Posts
    12
    I know what they do, just trying to get the o-p to do a little research, sounds like a homework assignment.

    check: command1 || command2 or command1 && command2

    Ther are many ways to do what he wants to do.

  10. #9

    thanks friends it got solved

    nohup ./a &./b &

    with this command both will run in background

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •