Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I use the terminal alot and was wondering how to chain commands so that it will do more than one thing. This way I could type one command and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    23

    Chaining Commands


    Hello, I use the terminal alot and was wondering how to chain commands so that it will do more than one thing. This way I could type one command and then walk away for a while. Just as an example: I type:
    Make
    Make zip
    cd ../"nextfolder"
    make
    make zip

    etc.
    Any help would be great!

  2. #2
    Linux Newbie jnike's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    120

    Post Re: commands

    Hi 007quick,

    I normally string commands together, when install a package or an application like;

    # ./confguire && make && make install

    This normally works for me....


    I hope you find this info useful.

    Jnike

  3. #3
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539
    ... or suppose you wanted to clear your screen, list all the files in your current directory in short form, save the output of that to a text file, and search that for files containing the word 'java'. You might try:

    clear && ls -s > saveList.txt | grep java saveList.txt

    and the output might be:

    4 helloworld.java
    4 javahelp2-jhindexer.sh
    4 javahelp2-jhsearch.sh
    8 javahelp2.spec

    If you need to do something like that repeatedly, you could save the commands (which can end up very complex) in a single file, defining that file as a script. So then you could do all that with just one command.

    This site is good.
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

  4. $spacer_open
    $spacer_close

Posting Permissions

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