cd returns New line.?
up vote
0
down vote
favorite
I want to go to $
prompt? But how without having to [Enter] twice ?
cd ..
works just fine and so doescd /
command-line bash
add a comment |Â
up vote
0
down vote
favorite
I want to go to $
prompt? But how without having to [Enter] twice ?
cd ..
works just fine and so doescd /
command-line bash
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to go to $
prompt? But how without having to [Enter] twice ?
cd ..
works just fine and so doescd /
command-line bash
I want to go to $
prompt? But how without having to [Enter] twice ?
cd ..
works just fine and so doescd /
command-line bash
edited Apr 22 at 7:36
Sergiy Kolodyazhnyy
64.9k9129282
64.9k9129282
asked Apr 22 at 6:39
Puneet Bapna
163
163
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
This is because the character is considered an "escape" in the Bash shell.
Take the following command:
sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages
We can instead rewrite this command like this:
sudo apt-get install some-package some-other-package
yet-another-package oh-my-we-have-a-lot-of-packages
and-still-another-package wow-so-many-packages
Bash will interpret the to mean "read the next line as part of this one." In your case, you type
cd
, so Bash expects you to give it another line.
If you want to go quickly back to your homedir (that is, ~
), you can either use cd ~
or just plain cd
.
add a comment |Â
up vote
4
down vote
With cd
you have entered a cd
command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.
With cd
alone (without ) you would go to your home directory,
cd ..
brings you to the parent directory of the current one, and cd /
to the base directory '/'.
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or^M
character. With` that modifies into newline. Similar example,
echo "$HOME"` vsecho $HOME
, where` modifies meaning of
$` from signifying a variable to literal$
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
This is because the character is considered an "escape" in the Bash shell.
Take the following command:
sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages
We can instead rewrite this command like this:
sudo apt-get install some-package some-other-package
yet-another-package oh-my-we-have-a-lot-of-packages
and-still-another-package wow-so-many-packages
Bash will interpret the to mean "read the next line as part of this one." In your case, you type
cd
, so Bash expects you to give it another line.
If you want to go quickly back to your homedir (that is, ~
), you can either use cd ~
or just plain cd
.
add a comment |Â
up vote
5
down vote
This is because the character is considered an "escape" in the Bash shell.
Take the following command:
sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages
We can instead rewrite this command like this:
sudo apt-get install some-package some-other-package
yet-another-package oh-my-we-have-a-lot-of-packages
and-still-another-package wow-so-many-packages
Bash will interpret the to mean "read the next line as part of this one." In your case, you type
cd
, so Bash expects you to give it another line.
If you want to go quickly back to your homedir (that is, ~
), you can either use cd ~
or just plain cd
.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
This is because the character is considered an "escape" in the Bash shell.
Take the following command:
sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages
We can instead rewrite this command like this:
sudo apt-get install some-package some-other-package
yet-another-package oh-my-we-have-a-lot-of-packages
and-still-another-package wow-so-many-packages
Bash will interpret the to mean "read the next line as part of this one." In your case, you type
cd
, so Bash expects you to give it another line.
If you want to go quickly back to your homedir (that is, ~
), you can either use cd ~
or just plain cd
.
This is because the character is considered an "escape" in the Bash shell.
Take the following command:
sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages
We can instead rewrite this command like this:
sudo apt-get install some-package some-other-package
yet-another-package oh-my-we-have-a-lot-of-packages
and-still-another-package wow-so-many-packages
Bash will interpret the to mean "read the next line as part of this one." In your case, you type
cd
, so Bash expects you to give it another line.
If you want to go quickly back to your homedir (that is, ~
), you can either use cd ~
or just plain cd
.
answered Apr 22 at 6:42
Kaz Wolfe
25.5k1370131
25.5k1370131
add a comment |Â
add a comment |Â
up vote
4
down vote
With cd
you have entered a cd
command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.
With cd
alone (without ) you would go to your home directory,
cd ..
brings you to the parent directory of the current one, and cd /
to the base directory '/'.
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or^M
character. With` that modifies into newline. Similar example,
echo "$HOME"` vsecho $HOME
, where` modifies meaning of
$` from signifying a variable to literal$
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
add a comment |Â
up vote
4
down vote
With cd
you have entered a cd
command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.
With cd
alone (without ) you would go to your home directory,
cd ..
brings you to the parent directory of the current one, and cd /
to the base directory '/'.
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or^M
character. With` that modifies into newline. Similar example,
echo "$HOME"` vsecho $HOME
, where` modifies meaning of
$` from signifying a variable to literal$
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
add a comment |Â
up vote
4
down vote
up vote
4
down vote
With cd
you have entered a cd
command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.
With cd
alone (without ) you would go to your home directory,
cd ..
brings you to the parent directory of the current one, and cd /
to the base directory '/'.
With cd
you have entered a cd
command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.
With cd
alone (without ) you would go to your home directory,
cd ..
brings you to the parent directory of the current one, and cd /
to the base directory '/'.
answered Apr 22 at 6:45
muclux
2,1231521
2,1231521
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or^M
character. With` that modifies into newline. Similar example,
echo "$HOME"` vsecho $HOME
, where` modifies meaning of
$` from signifying a variable to literal$
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
add a comment |Â
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or^M
character. With` that modifies into newline. Similar example,
echo "$HOME"` vsecho $HOME
, where` modifies meaning of
$` from signifying a variable to literal$
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M
character. With ` that modifies into newline. Similar example,
echo "$HOME"` vs echo $HOME
, where ` modifies meaning of
$` from signifying a variable to literal $
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
` doesn't specifically imply newline. The
` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M
character. With ` that modifies into newline. Similar example,
echo "$HOME"` vs echo $HOME
, where ` modifies meaning of
$` from signifying a variable to literal $
â Sergiy Kolodyazhnyy
Apr 22 at 7:42
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
â Sergiy Kolodyazhnyy
Apr 22 at 16:57
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027111%2fcd-returns-new-line%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password