Make an alias or shortcut to do more than one command several timesbash script to login to multiple Linux...

Spoken encryption

Drillers for petroleum strike gusher of blood

What is the difference between 1/3, 1/2, and full casters?

Keeping an "hot eyeball planet" wet

How to handle a player that cannot be convinced his actions are a problem for both GM and party

What is the lowest-speed bogey a jet fighter can intercept/escort?

Why are all my history books dividing Chinese history after the Han dynasty?

What is "I bet" in German?

Expansion with *.txt in the shell doesn't work if no .txt file exists

Why did Saturn V not head straight to the moon?

Anybody know what this small Nintendo stand is for?

kids pooling money for Lego League and taxes

What to do when you reach a conclusion and find out later on that someone else already did?

Is it legal for private citizens to "impound" e-scooters?

How to avoid unconsciously copying the style of my favorite writer?

Why was Sauron preparing for war instead of trying to find the ring?

What self-defense weapons are legal in London?

Why is drive/partition number still used?

Is it normal practice to screen share with a client?

How can I stop myself from micromanaging other PCs' actions?

Area of parallelogram = Area of square. Shear transform

This message is flooding my syslog, how to find where it comes from?

Why didn't Britain or any other European power colonise Abyssinia/Ethiopia before 1936?

Did the IBM PC use the 8088's NMI line?



Make an alias or shortcut to do more than one command several times


bash script to login to multiple Linux servers and collect the output of multiple commands through sshbash or Ksh quotes and command execBASH Operations on a for loop objectHow to make a prefill line with read command?How to ignore keys pushdSplitting data returned by a commandfeed options to curl as a variableNeed a awk/sed to replace the values present inside ${}How to make my bash function known to external programHow to write a shell script using terminal?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Example:



rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done"


Instead of typing that again inside my shell-script (bash)

I want to do all of the echo in a single command like a shortcut
Is there a way to do that?

Tried to do this but not work



alias EXAMPLE="rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done""


But it's doesn't work when I input the EXAMPLE command

Sorry for bad english










share|improve this question







New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

    – Gordon Davisson
    2 hours ago


















0















Example:



rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done"


Instead of typing that again inside my shell-script (bash)

I want to do all of the echo in a single command like a shortcut
Is there a way to do that?

Tried to do this but not work



alias EXAMPLE="rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done""


But it's doesn't work when I input the EXAMPLE command

Sorry for bad english










share|improve this question







New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

    – Gordon Davisson
    2 hours ago














0












0








0








Example:



rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done"


Instead of typing that again inside my shell-script (bash)

I want to do all of the echo in a single command like a shortcut
Is there a way to do that?

Tried to do this but not work



alias EXAMPLE="rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done""


But it's doesn't work when I input the EXAMPLE command

Sorry for bad english










share|improve this question







New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Example:



rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done"


Instead of typing that again inside my shell-script (bash)

I want to do all of the echo in a single command like a shortcut
Is there a way to do that?

Tried to do this but not work



alias EXAMPLE="rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done""


But it's doesn't work when I input the EXAMPLE command

Sorry for bad english







shell-script






share|improve this question







New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question







New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question






New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 2 hours ago









IISomeOneIIIISomeOneII

1111 silver badge11 bronze badges




1111 silver badge11 bronze badges




New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

    – Gordon Davisson
    2 hours ago



















  • Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

    – Gordon Davisson
    2 hours ago

















Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

– Gordon Davisson
2 hours ago





Use a function instead of an alias; also, join the commands with && so if one fails, it doesn't blindly continue through the rest of them.

– Gordon Davisson
2 hours ago










1 Answer
1






active

oldest

votes


















1














I'd just figured it out



CR()
{
rm -rf /sdcard/example
mkdir -p /sdcard/example
echo "example" > /sdcard/example/example.txt
chmod -Rf 777 /sdcard/example
echo "Done"
}






share|improve this answer








New contributor



IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    IISomeOneII is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532522%2fmake-an-alias-or-shortcut-to-do-more-than-one-command-several-times%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I'd just figured it out



    CR()
    {
    rm -rf /sdcard/example
    mkdir -p /sdcard/example
    echo "example" > /sdcard/example/example.txt
    chmod -Rf 777 /sdcard/example
    echo "Done"
    }






    share|improve this answer








    New contributor



    IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
























      1














      I'd just figured it out



      CR()
      {
      rm -rf /sdcard/example
      mkdir -p /sdcard/example
      echo "example" > /sdcard/example/example.txt
      chmod -Rf 777 /sdcard/example
      echo "Done"
      }






      share|improve this answer








      New contributor



      IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















        1












        1








        1







        I'd just figured it out



        CR()
        {
        rm -rf /sdcard/example
        mkdir -p /sdcard/example
        echo "example" > /sdcard/example/example.txt
        chmod -Rf 777 /sdcard/example
        echo "Done"
        }






        share|improve this answer








        New contributor



        IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        I'd just figured it out



        CR()
        {
        rm -rf /sdcard/example
        mkdir -p /sdcard/example
        echo "example" > /sdcard/example/example.txt
        chmod -Rf 777 /sdcard/example
        echo "Done"
        }







        share|improve this answer








        New contributor



        IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.








        share|improve this answer



        share|improve this answer






        New contributor



        IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.








        answered 2 hours ago









        IISomeOneIIIISomeOneII

        1111 silver badge11 bronze badges




        1111 silver badge11 bronze badges




        New contributor



        IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.




        New contributor




        IISomeOneII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.
























            IISomeOneII is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            IISomeOneII is a new contributor. Be nice, and check out our Code of Conduct.













            IISomeOneII is a new contributor. Be nice, and check out our Code of Conduct.












            IISomeOneII is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532522%2fmake-an-alias-or-shortcut-to-do-more-than-one-command-several-times%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

            The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

            Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...