CD vs Full Path per command
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
What is faster or considered better practice in shell scripts to first Cd into a directory then carry out commands or to write the full path?
For example: Is it better to write cd /directory1/
and then mkdir subdirectory/
or mkdir /directory1/subdirectory/
.
What if you need to execute a few commands in a directory (in the above example make a few subdirectories) then would the answer change?
When you say mkdir /directory1/subdirectory/
is it, in reality, doing cd /directory1/
and then mkdir subdirectory/
or not?
mkdir is just an example but the question can apply to alot of similar commands.
shell-script shell cd-command
add a comment |Â
up vote
0
down vote
favorite
What is faster or considered better practice in shell scripts to first Cd into a directory then carry out commands or to write the full path?
For example: Is it better to write cd /directory1/
and then mkdir subdirectory/
or mkdir /directory1/subdirectory/
.
What if you need to execute a few commands in a directory (in the above example make a few subdirectories) then would the answer change?
When you say mkdir /directory1/subdirectory/
is it, in reality, doing cd /directory1/
and then mkdir subdirectory/
or not?
mkdir is just an example but the question can apply to alot of similar commands.
shell-script shell cd-command
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
What is faster or considered better practice in shell scripts to first Cd into a directory then carry out commands or to write the full path?
For example: Is it better to write cd /directory1/
and then mkdir subdirectory/
or mkdir /directory1/subdirectory/
.
What if you need to execute a few commands in a directory (in the above example make a few subdirectories) then would the answer change?
When you say mkdir /directory1/subdirectory/
is it, in reality, doing cd /directory1/
and then mkdir subdirectory/
or not?
mkdir is just an example but the question can apply to alot of similar commands.
shell-script shell cd-command
What is faster or considered better practice in shell scripts to first Cd into a directory then carry out commands or to write the full path?
For example: Is it better to write cd /directory1/
and then mkdir subdirectory/
or mkdir /directory1/subdirectory/
.
What if you need to execute a few commands in a directory (in the above example make a few subdirectories) then would the answer change?
When you say mkdir /directory1/subdirectory/
is it, in reality, doing cd /directory1/
and then mkdir subdirectory/
or not?
mkdir is just an example but the question can apply to alot of similar commands.
shell-script shell cd-command
shell-script shell cd-command
asked 1 min ago
novice
185
185
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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%2funix.stackexchange.com%2fquestions%2f475905%2fcd-vs-full-path-per-command%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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');
);
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');
);
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