{"id":24218,"date":"2020-09-12T10:14:56","date_gmt":"2020-09-12T10:14:56","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=24218"},"modified":"2024-12-24T16:39:27","modified_gmt":"2024-12-24T16:39:27","slug":"which-command-displays-the-current-working-directory-in-linux","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/which-command-displays-the-current-working-directory-in-linux\/","title":{"rendered":"Which command displays the current working directory in Linux?"},"content":{"rendered":"<h2>Which command displays the current working directory in Linux?<\/h2>\n<p>Choose the correct option from the following options<\/p>\n<ul>\n<li>A) ls<\/li>\n<li>B) pwd<\/li>\n<li>C) cd<\/li>\n<li>D) mkdir<\/li>\n<\/ul>\n<h2>Correct Answer<\/h2>\n<p><strong>B) pwd<\/strong><\/p>\n<h2>Explanation<\/h2>\n<p>pwd stands for &#8220;print working directory.&#8221; When you run this command, it displays the full path of the current directory you are working in. For example, if you&#8217;re in a directory called \/home\/testingdocs\/Documents, executing pwd will output<\/p>\n<p><em>$ pwd<\/em><\/p>\n<p><em>\/home\/testingdocs\/Documents<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24221\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory.png\" alt=\"Current Working Directory\" width=\"1920\" height=\"678\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory-300x106.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory-1024x362.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory-768x271.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Current-Working-Directory-1536x542.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h2>Wrong options<\/h2>\n<p>ls lists the files and directories in the current directory but doesn\u2019t show the path to the current directory.<\/p>\n<p>cd stands for &#8220;change directory.&#8221; It&#8217;s used to navigate different directories but doesn\u2019t provide information about the current directory.<\/p>\n<p>mkdir stands for &#8220;make directory.&#8221; It is used to create new directories but doesn\u2019t provide any information about the current directory.<\/p>\n<p>Hence, pwd is the command specifically used to display the current working directory<br \/>\nin Linux.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Which command displays the current working directory in Linux? Choose the correct option from the following options A) ls B) pwd C) cd D) mkdir Correct Answer B) pwd Explanation pwd stands for &#8220;print working directory.&#8221; When you run this command, it displays the full path of the current directory you are working in. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-24218","post","type-post","status-publish","format-standard","hentry","category-linux","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/24218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=24218"}],"version-history":[{"count":8,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/24218\/revisions"}],"predecessor-version":[{"id":26520,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/24218\/revisions\/26520"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=24218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=24218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=24218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}