cd ` command meaning and how to exit it?Terminal shows > after entering What mode does the terminal go into when I type a single quote?Unable to enter new commands in terminal — stuck with “>”Using grep with pipe and ampersand to filter errors from findConfigure bash to print exit status of every command enteredHow to remove PATH variable on Ubuntu 14.04?Exit from both root and user with one commandhelp needed understaning ls format meaningHow exit from tty4 terminal without using Alt+SysRq+B to exit?Exit terminal after dd command complete“XXX is hashed” meaning from type command?How does the history command work?Open XFCE Terminal Window and Run command in same Window

Splitting polygons and dividing attribute value proportionally using ArcGIS Pro?

What does “two-bit (jerk)” mean?

What does the copyright in a dissertation protect exactly?

Justification of physical currency in an interstellar civilization?

Why was Gemini VIII terminated after recovering from the OAMS thruster failure?

Extracting the parent, leaf, and extension from a valid path

A♭ major 9th chord in Bach is unexpectedly dissonant/jazzy

Does restarting the SQL Services (on the machine) clear the server cache (for things like query plans and statistics)?

What chord could the notes 'F A♭ E♭' form?

How does jetBlue determine its boarding order?

How does "politician" work as a job/career?

GitLab account hacked and repo wiped

Can anyone identify this unknown 1988 PC card from The Palantir Corporation?

Is it safe to keep the GPU on 100% utilization for a very long time?

Was there a dinosaur-counter in the original Jurassic Park movie?

How do I give a darkroom course without negs from the attendees?

Do the Zhentarim fire members for killing fellow members?

What calendar would the Saturn nation use?

Gift for mentor after his thesis defense?

What is more safe for browsing the web: PC or smartphone?

Picking a theme as a discovery writer

All of my Firefox add-ons have been disabled suddenly, how can I re-enable them?

Make me a minimum magic sum

Latex editor/compiler for Windows and Powerpoint



cd ` command meaning and how to exit it?


Terminal shows > after entering What mode does the terminal go into when I type a single quote?Unable to enter new commands in terminal — stuck with “>”Using grep with pipe and ampersand to filter errors from findConfigure bash to print exit status of every command enteredHow to remove PATH variable on Ubuntu 14.04?Exit from both root and user with one commandhelp needed understaning ls format meaningHow exit from tty4 terminal without using Alt+SysRq+B to exit?Exit terminal after dd command complete“XXX is hashed” meaning from type command?How does the history command work?Open XFCE Terminal Window and Run command in same Window






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








1















when I type



$ cd `


into a terminal, then I get this



>


even ls or cd is not working, please explain the meaning of the above command and how do I exit it?










share|improve this question









New contributor



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














  • 2





    Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

    – FedonKadifeli
    4 hours ago












  • As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

    – John1024
    4 hours ago












  • Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

    – wjandrea
    3 hours ago












  • Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

    – wjandrea
    3 hours ago

















1















when I type



$ cd `


into a terminal, then I get this



>


even ls or cd is not working, please explain the meaning of the above command and how do I exit it?










share|improve this question









New contributor



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














  • 2





    Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

    – FedonKadifeli
    4 hours ago












  • As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

    – John1024
    4 hours ago












  • Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

    – wjandrea
    3 hours ago












  • Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

    – wjandrea
    3 hours ago













1












1








1








when I type



$ cd `


into a terminal, then I get this



>


even ls or cd is not working, please explain the meaning of the above command and how do I exit it?










share|improve this question









New contributor



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











when I type



$ cd `


into a terminal, then I get this



>


even ls or cd is not working, please explain the meaning of the above command and how do I exit it?







command-line bash cd






share|improve this question









New contributor



Vaishnava Hari 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



Vaishnava Hari 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








edited 4 hours ago









Kulfy

5,68372147




5,68372147






New contributor



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








asked 4 hours ago









Vaishnava HariVaishnava Hari

61




61




New contributor



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




New contributor




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









  • 2





    Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

    – FedonKadifeli
    4 hours ago












  • As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

    – John1024
    4 hours ago












  • Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

    – wjandrea
    3 hours ago












  • Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

    – wjandrea
    3 hours ago












  • 2





    Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

    – FedonKadifeli
    4 hours ago












  • As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

    – John1024
    4 hours ago












  • Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

    – wjandrea
    3 hours ago












  • Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

    – wjandrea
    3 hours ago







2




2





Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

– FedonKadifeli
4 hours ago






Ctrl+C or another `. All quotes must be terminated properly. See en.wikipedia.org/wiki/Command_substitution

– FedonKadifeli
4 hours ago














As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

– John1024
4 hours ago






As for the meaning, the single backquote, ` , tells the shell that you are starting a command substitution and > means that the shell wants you to complete it.

– John1024
4 hours ago














Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

– wjandrea
3 hours ago






Duplicate on Unix & Linux: What is the effect of a lone backtick at the end of a command line?, related: What mode does the terminal go into when I type a single quote?, Terminal shows > after entering backslash

– wjandrea
3 hours ago














Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

– wjandrea
3 hours ago





Possible duplicate of Unable to enter new commands in terminal — stuck with “>”

– wjandrea
3 hours ago










2 Answers
2






active

oldest

votes


















4














Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.



> is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.



Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do



$ a=`
> expr 1 + 3`


will be interpreted as



$ a=`expr 1 + 3`


So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.



To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?






share|improve this answer

























  • This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

    – user000001
    3 hours ago












  • Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

    – Kulfy
    3 hours ago







  • 1





    Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

    – user000001
    3 hours ago







  • 1





    @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

    – Kulfy
    3 hours ago












  • Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

    – Charles Duffy
    2 hours ago



















3














The backticks create an execution environment called command substitution. It is used like this for example:



echo "The date today is `date`"


Here the date command is executed first, and its output replaces the part between the backticks, so in the end you get a string with the current date.



Command substitution may span multiple lines, so when you type



cd `


and press enter, bash expects you to complete the command substitution, before executing the cd command. This can be broken either by closing the backtick and pressing enter, or by pressing CTRL-C (This will abort the command without anything getting executed).



Note that modern guidelines prefer to avoid the backtick syntax for command substitution, and to use $( ) instead, so the first example would be:



echo "The date today is $(date)"





share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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
    );



    );






    Vaishnava Hari 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%2faskubuntu.com%2fquestions%2f1141052%2fcd-command-meaning-and-how-to-exit-it%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.



    > is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.



    Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do



    $ a=`
    > expr 1 + 3`


    will be interpreted as



    $ a=`expr 1 + 3`


    So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.



    To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?






    share|improve this answer

























    • This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

      – user000001
      3 hours ago












    • Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

      – Kulfy
      3 hours ago







    • 1





      Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

      – user000001
      3 hours ago







    • 1





      @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

      – Kulfy
      3 hours ago












    • Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

      – Charles Duffy
      2 hours ago
















    4














    Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.



    > is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.



    Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do



    $ a=`
    > expr 1 + 3`


    will be interpreted as



    $ a=`expr 1 + 3`


    So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.



    To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?






    share|improve this answer

























    • This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

      – user000001
      3 hours ago












    • Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

      – Kulfy
      3 hours ago







    • 1





      Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

      – user000001
      3 hours ago







    • 1





      @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

      – Kulfy
      3 hours ago












    • Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

      – Charles Duffy
      2 hours ago














    4












    4








    4







    Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.



    > is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.



    Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do



    $ a=`
    > expr 1 + 3`


    will be interpreted as



    $ a=`expr 1 + 3`


    So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.



    To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?






    share|improve this answer















    Backticks work in pairs. Bash is waiting for you to provide another backtick to complete the command/expression.



    > is simply a prompt for newline which is determined by the value of PS2 generally defined in .bashrc.



    Whenever you hit Enter (if the command/expression is incomplete, i.e. backtick isn't closed), bash expects you to complete the command/expression either in one line or multiple lines. For example, you want to evaluate value of 'a' using expr. You can do



    $ a=`
    > expr 1 + 3`


    will be interpreted as



    $ a=`expr 1 + 3`


    So, if you want to run some command either complete the required expression or if there is no command/expression required in between backticks, refrain from using that. Another way is to use Ctrl+C, but that would be a Keyboard Interrupt and will make your command to terminate immediately.



    To read more about backticks, read these questions on U&L: Understanding backtick and What does ` (backquote/backtick) mean in commands?







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 3 hours ago

























    answered 4 hours ago









    KulfyKulfy

    5,68372147




    5,68372147












    • This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

      – user000001
      3 hours ago












    • Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

      – Kulfy
      3 hours ago







    • 1





      Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

      – user000001
      3 hours ago







    • 1





      @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

      – Kulfy
      3 hours ago












    • Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

      – Charles Duffy
      2 hours ago


















    • This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

      – user000001
      3 hours ago












    • Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

      – Kulfy
      3 hours ago







    • 1





      Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

      – user000001
      3 hours ago







    • 1





      @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

      – Kulfy
      3 hours ago












    • Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

      – Charles Duffy
      2 hours ago

















    This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

    – user000001
    3 hours ago






    This is a good answer but a=`echo $b` is in most cases a bad example. You will get the value of $b, with all sequences of whitespace replaced with single spaces, then each word will be expanded as a glob based on the files of the current directory, and then all trailing newlines will be trimmed, and a single newline will be added in the end. I'd say that 99.9% of the time you'd want a=$b, and the rest a=$(echo "$b") if you want a single trailing newline.

    – user000001
    3 hours ago














    Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

    – Kulfy
    3 hours ago






    Hey @user000001, thank you for your valuable comment. What about a=`expr 1 + 3` example? (Formatting in comments sucks!!!)

    – Kulfy
    3 hours ago





    1




    1





    Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

    – user000001
    3 hours ago






    Yes, that's much better, though surely someone will come along and complain that since the question is tagged [bash], you'd be using a=$((b+3)) in real code instead of expr ;)

    – user000001
    3 hours ago





    1




    1





    @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

    – Kulfy
    3 hours ago






    @user000001 Replaced. The question is about ``` ` ``` and >, I don't think such complain would occur ;-).

    – Kulfy
    3 hours ago














    Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

    – Charles Duffy
    2 hours ago






    Consider the complaint made -- we've got so many people using 1970s-era expr syntax because they're used to seeing it around so they think it's normal/expected/correct, vs standardized-since-the-1990s (and thus not at all a bashism) $(( ... )) POSIX math syntax. date is a lot more defensible as an example, since it's legitimately needed when writing code for POSIX shells (or versions of bash that aren't recent 4.x adding printf '%(...)T') today.

    – Charles Duffy
    2 hours ago














    3














    The backticks create an execution environment called command substitution. It is used like this for example:



    echo "The date today is `date`"


    Here the date command is executed first, and its output replaces the part between the backticks, so in the end you get a string with the current date.



    Command substitution may span multiple lines, so when you type



    cd `


    and press enter, bash expects you to complete the command substitution, before executing the cd command. This can be broken either by closing the backtick and pressing enter, or by pressing CTRL-C (This will abort the command without anything getting executed).



    Note that modern guidelines prefer to avoid the backtick syntax for command substitution, and to use $( ) instead, so the first example would be:



    echo "The date today is $(date)"





    share|improve this answer





























      3














      The backticks create an execution environment called command substitution. It is used like this for example:



      echo "The date today is `date`"


      Here the date command is executed first, and its output replaces the part between the backticks, so in the end you get a string with the current date.



      Command substitution may span multiple lines, so when you type



      cd `


      and press enter, bash expects you to complete the command substitution, before executing the cd command. This can be broken either by closing the backtick and pressing enter, or by pressing CTRL-C (This will abort the command without anything getting executed).



      Note that modern guidelines prefer to avoid the backtick syntax for command substitution, and to use $( ) instead, so the first example would be:



      echo "The date today is $(date)"





      share|improve this answer



























        3












        3








        3







        The backticks create an execution environment called command substitution. It is used like this for example:



        echo "The date today is `date`"


        Here the date command is executed first, and its output replaces the part between the backticks, so in the end you get a string with the current date.



        Command substitution may span multiple lines, so when you type



        cd `


        and press enter, bash expects you to complete the command substitution, before executing the cd command. This can be broken either by closing the backtick and pressing enter, or by pressing CTRL-C (This will abort the command without anything getting executed).



        Note that modern guidelines prefer to avoid the backtick syntax for command substitution, and to use $( ) instead, so the first example would be:



        echo "The date today is $(date)"





        share|improve this answer















        The backticks create an execution environment called command substitution. It is used like this for example:



        echo "The date today is `date`"


        Here the date command is executed first, and its output replaces the part between the backticks, so in the end you get a string with the current date.



        Command substitution may span multiple lines, so when you type



        cd `


        and press enter, bash expects you to complete the command substitution, before executing the cd command. This can be broken either by closing the backtick and pressing enter, or by pressing CTRL-C (This will abort the command without anything getting executed).



        Note that modern guidelines prefer to avoid the backtick syntax for command substitution, and to use $( ) instead, so the first example would be:



        echo "The date today is $(date)"






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 4 hours ago

























        answered 4 hours ago









        user000001user000001

        5031413




        5031413




















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









            draft saved

            draft discarded


















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












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











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














            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f1141052%2fcd-command-meaning-and-how-to-exit-it%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

            Log på Navigationsmenu

            Creating second map without labels using QGIS?How to lock map labels for inset map in Print Composer?How to Force the Showing of Labels of a Vector File in QGISQGIS Valmiera, Labels only show for part of polygonsRemoving duplicate point labels in QGISLabeling every feature using QGIS?Show labels for point features outside map canvasAbbreviate Road Labels in QGIS only when requiredExporting map from composer in QGIS - text labels have moved in output?How to make sure labels in qgis turn up in layout map?Writing label expression with ArcMap and If then Statement?

            Nuuk Indholdsfortegnelse Etyomologi | Historie | Geografi | Transport og infrastruktur | Politik og administration | Uddannelsesinstitutioner | Kultur | Venskabsbyer | Noter | Eksterne henvisninger | Se også | Navigationsmenuwww.sermersooq.gl64°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.75064°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.750DMI - KlimanormalerSalmonsen, s. 850Grønlands Naturinstitut undersøger rensdyr i Akia og Maniitsoq foråret 2008Grønlands NaturinstitutNy vej til Qinngorput indviet i dagAntallet af biler i Nuuk må begrænsesNy taxacentral mødt med demonstrationKøreplan. Rute 1, 2 og 3SnescootersporNuukNord er for storSkoler i Kommuneqarfik SermersooqAtuarfik Samuel KleinschmidtKangillinguit AtuarfiatNuussuup AtuarfiaNuuk Internationale FriskoleIlinniarfissuaq, Grønlands SeminariumLedelseÅrsberetning for 2008Kunst og arkitekturÅrsberetning for 2008Julie om naturenNuuk KunstmuseumSilamiutGrønlands Nationalmuseum og ArkivStatistisk ÅrbogGrønlands LandsbibliotekStore koncerter på stribeVandhund nummer 1.000.000Kommuneqarfik Sermersooq – MalikForsidenVenskabsbyerLyngby-Taarbæk i GrønlandArctic Business NetworkWinter Cities 2008 i NuukDagligt opdaterede satellitbilleder fra NuukområdetKommuneqarfik Sermersooqs hjemmesideTurist i NuukGrønlands Statistiks databankGrønlands Hjemmestyres valgresultaterrrWorldCat124325457671310-5