Lesson 2: Where am I and what's here — pwd and ls
Last lesson we met the command -> output loop. Now we add two commands that answer the first questions on any new server: 'where am I?' (pwd, which prints the current directory's path) and 'what's here?' (ls, which lists the files and directories around you). Both are read-only — completely safe and
pwd is like asking 'which room am I standing in?' — you get the full address. ls is like turning on the light to see what's in the room.
- pwd
- Short for print working directory — prints the full path of the directory you are currently in.
- ls
- Short for list — shows the files and directories in the current directory.
- path
- The address of a directory or file in the system, separated by slashes, e.g. /home/deploy or /var/log.
- home directory (~)
- The user's personal directory. The ~ sign is shorthand for it; for the user deploy it is /home/deploy.