Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

linux commands help!!!

  • 07-07-2011 01:58AM
    #1
    Closed Accounts Posts: 3


    hey guys am kinda gettin started on linux and how to use and stuff and would appreciate any help how to i write the following shell commands or pipelines to output the messages:

    1)one
    two
    three
    the solution must involve a loop

    2)list all running process belonging to the user with account name "jones".


    3)count the number of times the text blubber occurs in the file book.txt leaving the number in the file count.txt


Comments

  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    1. Using a bash script..
    array=(one two three)

    for i in "${array[@]}"
    do
    echo $i
    done


  • Registered Users, Registered Users 2 Posts: 6,265 ✭✭✭MiCr0


    university - is this homework or does it have some purpose?

    I've unapproved 2 of the replies as it looks like they're doing your work for you


  • Registered Users, Registered Users 2 Posts: 297 ✭✭stesh


    how about
    man
    


  • Registered Users, Registered Users 2 Posts: 1,929 ✭✭✭PrzemoF


    OP, no one will do it for you

    ad 1. sorry I don't understand what do you want to achieve
    ad 2. man ps
    ad 3. man grep, man wc, google for "linux pipe"


Advertisement