What would you enter at the command prompt on a Linux system to display a list of files and subdirectories that exist within the present working direc?


To print the current working directory, we use the pwd command in the Linux system.

pwd (print working directory) – The pwd command is used to display the name of the current working directory in the Linux system using the terminal. This is a shell building command that is available in most Unix shells such as Bourne shell, ash, bash, kash, and zsh.

Syntax

The general syntax of the pwd command is as follows −

pwd [-LP]

A brief description of options available in the pwd command.

Sr.No.
Option & Description
1
-L (logical)
Display the value of $pwd if it names the current working directory
2
-P (physical)
Display the physical directory, without any soft link
3
--help
Displays a help message and then exits.

By default, the pwd works as if -L option was specified.

Exit Status

The pwd command returns true unless an invalid option supplied or the current directory could not be read.

To display the current working directory, we use the pwd command in the Linux/Unix system as shown below.

vikash@tutorialspoint:~ pwd
/home/vikash

To display the physical directory instead of symbolic links or soft links, we use -P option with the pwd command in the Linux/Unix system as shown below.

vikash@tutorialspoint:~ pwd -P
/home/vikash

To display more about the pwd command we use -help option with the pwd command as shown below.

vikash@tutorialspoint:~ pwd --help

After execution of above command. It will be prompt a short description with available options available in the pwd command.

What would you enter at the command prompt on a Linux system to display a list of files and subdirectories that exist within the present working direc?

Updated on 01-Jul-2021 14:20:29

  • Related Questions & Answers
  • How to change the shell working directory in Linux?
  • How to set the current working directory in Python?
  • Get the Current Working Directory in Java
  • How to know current working directory in Python?
  • Find out the current working directory in C/C++
  • Java Program to Get Current Working Directory
  • How to display the first part of the file in the Linux system?
  • How to display the last part of the file in the Linux system?
  • How to list the directory content in Linux?
  • How to flushes file system buffers in the Linux operating system?
  • Specifying working directory while executing FM SXPG_COMMAND_EXECUTE in SAP system
  • How to get the current username and directory in Golang?
  • How to move jobs to the background in the Linux system?
  • Linux – How to find the files existing in one directory but not in the other directory?
  • How to change the root directory of the current process in Python?

  • School Seneca College
  • Course Title CPR 101
  • Pages 4
  • Ratings 100% (2) 2 out of 2 people found this document helpful

This preview shows page 1 - 2 out of 4 pages.

1.4.6 Practice QuestionsQuestion 1:What would you enter at the command prompt to start a new Bourne-again shell (bash) session?

Get answer to your question and much more

Question 2:What would you enter at the command prompt on a Linux system to display the IP addresses andthe subnet masks assigned to each network interface on a Linux system?

Get answer to your question and much more

Question 3:What would you enter at the command prompt on a Linux system to display a list of files andsubdirectories that exist within the present working directory?

Get answer to your question and much more

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 4 pages?

Upload your study docs or become a

Course Hero member to access this document

Tags

Login, IP address, home directory, Working directory, PWD, Ifconfig

What would you enter at the command prompt on a Linux system to display the present working director?

pwd (print working directory) – The pwd command is used to display the name of the current working directory in the Linux system using the terminal. This is a shell building command that is available in most Unix shells such as Bourne shell, ash, bash, kash, and zsh.

What would you enter at the command prompt on a Linux system to display the IP addresses and the subnet?

The ifconfig command displays the IP addresses and the subnet masks assigned to each network interface installed on a Linux system.

What would you enter at the command prompt to display a list of files?

You can use the DIR command by itself (just type “dir” at the Command Prompt) to list the files and folders in the current directory.

What would you enter at the command prompt to start a new born again show bash session?

What would you enter at the command prompt to start a new Bourne-again shell (bash) session? The bash command opens a Bourne-again sheel (bash) session. The Bourne-again shell (bash) is the standard shell used in most Linux computers. It uses commands similar to a UNIX shell.