Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux pwd command learning experience     - Boot-Repair Tool - repair of frequent start-up problems (Linux)

- Linux reserves the rest of the file to delete several (Linux)

- MyCAT easy entry (Database)

- How to install the NVIDIA 358.16 driver in Ubuntu 15.10,14.04 (Linux)

- Using Vagrant create cross-platform development environment (Linux)

- Oracle 11g manually create a database (Database)

- mysqldump MySQL command-line tool (Database)

- Why everybody ought to know LLVM (Linux)

- Linux argument references and command substitution (Linux)

- Remote database using RMAN recovery test (RAC return to single-instance database) (Database)

- To assign multiple IP addresses NIC on the CentOS 7 (Linux)

- Ceph cluster disk is no workaround for the remaining space (Server)

- GRUB and Linux system repair (Linux)

- Docker installation under CentOS7 (Linux)

- Ubuntu under VirtualBox virtual machine serial port settings (Linux)

- Ubuntu deploying Solr (4.4) to Tomcat (7.0.53) (Server)

- Guide: Trickle restrict application bandwidth usage (Linux)

- Ubuntu 14.10 splash screen brightness settings (Linux)

- Android Studio Clear Project or Rebuild Project Error (Linux)

- Use read command to read user input (Programming)

 
         
  Linux pwd command learning experience
     
  Add Date : 2018-11-21      
         
         
         
  Have you ever come across the need to know the current directory no knowledge? There is no want to copy the current directory hierarchy but do not know how to start? As the saying goes Ask a police officer for help, want to know the directory hierarchy natural looking pwd. So the question is:

What is pwd

pwd meaning Print Working Directory, print working directory is intended as the name suggests, that prints the user's current directory, it will print out from the root directory (/) to the beginning of the current full path to the directory where. This command is a shell built-in commands, and can be used in most of the shell, such as bash, Bourne shell, ksh, zsh, and so on.

Format:

# Pwd [OPTION]
Common parameters:

 Option Description
 -L (Ie logical path logical) path using the environment, even if it contains a symbolic link
 -P (Ie, the physical path physical) to avoid all symlinks
 -help display this help and exit
 -version output version information and exit
If you use the '-L' and '-P', '- L' will have a higher priority. If you do not specify the parameters, pwd would avoid all symbolic links, that will use the '-P' parameter. Well, Here are the specific chestnuts. Our chestnuts are using the "/ bin / pwd" of. It and "pwd" What difference does it make?

With distinction pwd / bin / pwd of

What's the difference? Direct use "pwd" means using shell built-in pwd. Your shell may have a different version of pwd. For details, please refer to the manual. When you use the / bin / pwd, we call the binary version of the command. Although the binary version has more options, but they both can print the current directory. Well, Let's continue our pwd chestnuts combat.

8 pwd command chestnuts

1. Print the current directory:

1 linuxhost @ linuxhost: ~ $ / bin / pwd
2
3 / home / linuxhost
2. Create a symbolic link to the folder (for example, htm create a link to the / var / www / html in the home directory). Into the newly created directory and print out containing and free of symbolic links directory:

1 linuxhost @ linuxhost: ~ $ ln -s / var / www / html / htm
2 linuxhost @ linuxhost: ~ $ cd htm
3. To print from the current environment, even if it is a directory containing a symbolic link:

1 linuxhost @ linuxhost: ~ $ / bin / pwd -L
2
3 / home / linuxhost / htm
4. resolves all symbolic link to print the current actual physical directory:

1 linuxhost @ linuxhost: ~ $ / bin / pwd -P
2
3 / var / www / html
5. Print version pwd command:

1 linuxhost @ linuxhost: ~ $ / bin / pwd --version
2
3 pwd (GNU coreutils) 8.23
4 Copyright (C) 2014 Free Software Foundation, Inc.
5 License GPLv3 +: GNU GPL version 3 or later .
6 This is free software: you are free to change and redistribute it.
7 There is NO WARRANTY, to the extent permitted by law.
8
9 Written by Jim Meyering.
 6. Print all paths containing the executable pwd:

1 linuxhost @ linuxhost: ~ $ type -a pwd
2
3 pwd is a shell builtin
4 pwd is / bin / pwd
7. The value of the variable to store "pwd" command (for example: a), and print from the value of the variable (for observation shell script is very important).

1 linuxhost @ linuxhost: ~ $ a = $ (pwd)
2 linuxhost @ linuxhost: ~ $ echo "Current working directory is: $ a"
3
4 Current working directory is: / home / linuxhost
8. Disposable obtain the current working directory and a directory of the previous work:

1 linuxhost @ linuxhost: ~ $ echo "$ PWD $ OLDPWD"
2
3 / home / home / linuxhost
     
         
         
         
  More:      
 
- C # how to generate a folder or file automatically rename (Programming)
- Based AutoYaST automated installation of SUSE practice (Linux)
- GitLab remote backup of Linux Shell Scripting (Linux)
- 25 Git Usage Tips (Linux)
- Ubuntu 13.04 configure MyEclipse 10.7 Environment (Linux)
- sa weak passwords intrusion prevention (Linux)
- Linux Getting Started tutorial: XWindow what (Linux)
- IBM Data Studio to create objects using ---- double quotes / sensitive issues and the table / column renaming (Database)
- Linux virtual memory and physical memory (Linux)
- Extended VMware Ubuntu root partition size (Linux)
- Linux command line to put on your coat GUI (Linux)
- Configuring Eclipse Note Templates (Linux)
- Redis is installed in Ubuntu 14.04 (Database)
- Vim useful plugin: EasyGrep (Linux)
- Red Hat Enterprise Linux 6.4 Configuring VNC Remote Desktop login access (Linux)
- How to understand Python yield keyword (Programming)
- Ten to improve the efficiency of the Linux bash tricks (Linux)
- CentOS7 installation configuration Redis-3.0.0 (Database)
- Guide: Trickle restrict application bandwidth usage (Linux)
- Linux NIC configuration (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.