Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
InfrastructureJuniorOccasionalPractical

Which Linux commands do you use to understand where you are and inspect files in a directory?

Answer

Use `pwd` to print the current directory, `cd` to change directories and `ls` to list entries. In troubleshooting, `ls -la` is especially useful because it includes hidden entries plus ownership and permission information. Use absolute or relative paths deliberately and quote paths that contain spaces.

Strong answer includes

  • pwd, cd and ls have distinct roles
  • ls -la exposes hidden files and permissions
  • understands absolute versus relative paths

Practical example

After SSHing to a test server, run `pwd`, then `ls -la`, and inspect the expected deployment directory before changing or deleting anything. That quickly catches a wrong working directory or missing artifact.

#linux#filesystem#command-line

Sources

GNU Coreutils manualGNU Project · Linux and Unix-like filesystem, text, disk-usage and shell utility behavior50 Linux Interview Questions (With Answers)Toolmingo · Recurrence signal for Linux filesystem, permissions, processes, systemd, networking and shell-command interview topics