exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 406 discussion

Actual exam question from Cisco's 200-901
Question #: 406
Topic #: 1
[All 200-901 Questions]

Within a Bash shell, which command adds the current directory to the PATH without overwriting the current PATH for this shell and any subshells that are spawned from the current shell?

  • A. export $PATH=PATH:$(pwd)
  • B. set PATH=$PATH:${pwd}
  • C. export PATH=$PATH:$(pwc1)
  • D. set PATH=PATH+$(pwd)
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
daniii89
3 months, 1 week ago
Selected Answer: C
The goal is to add the current directory (pwd, which prints the working directory) to the PATH variable without overwriting the existing PATH. The correct way to do this in a Bash shell is: export PATH=$PATH:$(pwd) • export → Ensures that PATH is available to subshells. • $PATH → Keeps the existing PATH values. • $(pwd) → Expands to the current working directory. • : → Acts as a separator between paths in PATH. Its C if its a copy error. This command appends the current directory to the PATH, allowing any executables in this directory to be run without specifying their full path.
upvoted 2 times
...
dexcript
9 months, 2 weeks ago
Selected Answer: C
I would choose C, because I think there's a typo must be pwd not pwc1, all other alternatives are wrong.
upvoted 2 times
...
jbmac
1 year, 1 month ago
C. export PATH=$PATH:$(pwd) The correct command to add the current directory to the PATH without overwriting the current PATH in the Bash shell is: C. export PATH=$PATH:$(pwd) I think the answer had an issue with OCR (converting image to text)
upvoted 2 times
...
lmqnam
1 year, 5 months ago
The correct answer is export PATH=$PATH:$(pwd) Maybe A or C has a typo.
upvoted 1 times
...
Nicetomeetyou
1 year, 10 months ago
Selected Answer: A
Tested on Centos: answer C returns error, answer A works: export PATH=$PATH:$(pwc1) -bash: pwc1: command not found
upvoted 2 times
...
throwaway_account
1 year, 11 months ago
Answer C is accurate, just some bad OCR. When you set a variable in Linux, you don't use the $, so A is wrong. You only use a $ when referring to a variable, so C should be: export PATH=$PATH:$(pwd) pwc1 would be a very common mistake for an OCR algo, c1 looks visually similar to d.
upvoted 3 times
...
starbuggs
2 years ago
Selected Answer: A
C doesn't make sense, gotta be A
upvoted 1 times
...
cerifyme85
2 years, 3 months ago
Selected Answer: A
why not A C does not make any sense
upvoted 3 times
Woonesuf
2 years, 2 months ago
According to this page, 'C' looks correct. https://stackoverflow.com/questions/27188856/adding-any-current-directory-to-the-search-path-in-linux
upvoted 2 times
m4xr1s
2 years, 2 months ago
No it doesnt. A looks correct
upvoted 1 times
...
rtg2123
2 years, 2 months ago
yes, but it needs to be pwd instead of pwc1 ...
upvoted 4 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago