![]() This changes the current working directory, which In the following example, Lise uses an absolute path to navigate to a sub-subdirectory. Square brackets ( ]) are used to denote optional arguments that are themselvesĭependent on the existence of other arguments. The convention denotes optional terms that may be present. Thus, if you see cd, you should type in something like cd mydir. You should not type in the less-than ( ) symbols themselves. Using is a common convention for terms that must be included and for which a real value must be substituted. If Lise adds a space followed by the path of another directory, the To help dictate its behavior: ~/fission $ cd However, the cd command can also be customized with anĪrgument, a parameter that follows the command The shell responds by providing the absolute path to the current working directory. Home directory will be printed as an absolute path: ~ $ pwd To double-check, pwd can be executed and the ![]() The prompt reflects the new current workingĭirectory, home (~). That’s where it takes her: ~/fission $ cdĬhange directories to the default location, the home directory!Īs you can see in this example, executing the cd command with no arguments Letters, the cd command assumes she wants to go to her home directory, so Lise can change directories with the cd command. However, to actually navigate to any of these directories, Lise will need the command cd. The ls command can inform Lise about the contents of directories in her filesystem. The shell responds by listing the three directories contained in the applications directory. Lise lists the contents of the applications directory without leaving the fission directory. The applications directory without entering it, she can execute: ~/fission $ ls applications Lise can also provide an argument to the ls command. In the shell, directories may be rendered in a different color than files or may be indicated with a forward slash ( /) at the end of their name, as in the preceding example. When she lists the contents, she sees that there are two files and one The shell responds by listing the contents of the current directory. In the fission directory within her home directory, Lise types ls and then presses Enter. Home directory, ls results in the following list of its contents: ~/fission $ lsĪpplications/ heat-production.txt neutron-release.txt Type ls at the command prompt and press Enter to see theįrom the fission directory in Professor Meitner’s Indeed, the tilde is anĪbbreviation for the home directory path-that is, the sequence ofīecause the path is defined relative to the absolute top of theĪnd this: /filespace/people/l/lisemeitner/fissionĮxercise: List the Contents of a Directory It seems that the tilde has entirely replaced the home directory path To: /filespace/people/l/lisemeitner/fission Returning to the previous example, let us compare: ~/fission Wilhelm Institute, this might appear as: $ Meitner, who held a research position at the prestigious Kaiser Username and the name of the computer as well: $įor Prof. Thus, when you log in, you probably see the command prompt telling you you’re in your home directory: ~ $ The tilde ( ~) character can be used as a shortcut to your homeĭirectory. The shell starts your session from a special directory called your homeĭirectory. Let’s take a look at how Lise would have navigated through this directory structure. Meitner’s research computer might have contained a set ofĭirectories holding files about her theory of fission as well as ideas about itsĪpplication (see Figure 1-2). Theoretical framework for neutron-induced fission. ![]() The full, absolute path of the directory you’reĬurrently working in with the command pwd (print working directory).īash was not available in the 1930s, when Lise Meitner was developing a Bringing these together, note that you can always print out Working directory instead is a relative path. Any path that describes a location relative to the current Relative paths therefore often start with aĪs we have learned, absolute paths describe a file space location relative to the rootĭirectory. Working directory is denoted with one dot (.), while the directory immediately above it (its “parent”) isĭenoted with two dots (.). ![]() It is also used to separate the names of directories in a path, as seen in Figure 1-2. The / syntax is used at the beginning of a path to indicate the top-levelĭirectory.
0 Comments
Leave a Reply. |