Przejdลบ do treล›ci

๐Ÿš€ Shell 101: Getting Started

Understanding how to launch and interact with a shell is fundamental. This section introduces core concepts such as launching the shell, interpreting prompts, and basic interaction.

๐Ÿ”Œ Launching the Shell

Depending on your system, there are several ways to open a shell:

Graphical Desktops

  • Click the terminal icon in your dock/taskbar.
  • Search for โ€œTerminalโ€ in applications menu.

Command Line Access

On servers or headless machines:

1
Ctrl + Alt + F2-F6  # Switch to TTY consoles (Linux)

Remote Access

Use SSH to connect remotely:

1
ssh username@hostname

Once launched, youโ€™ll see a prompt indicating readiness to accept commands.


๐Ÿ–ฅ Understanding the Prompt

A typical prompt looks like this:

1
user@host:~/dir$

Breaking it down: - user: Current logged-in user - host: Machine name - ~/dir: Current working directory (~ means home) - $: Standard user prompt (# indicates root)

Customize your prompt via PS1 variable in .bashrc or .zshrc.


โŒจ๏ธ Basic Interaction

Type any valid command followed by Enter:

1
2
$ ls
Documents Downloads Pictures

If the command exists, its output appears. Otherwise:

1
2
$ foobar
Command 'foobar' not found...

Commands can take arguments and flags:

1
2
$ ls -l /home/user/Documents
-rw-r--r-- 1 user group 1024 Jan 1 12:00 file.txt


Command Description
pwd Print Working Directory
cd Change Directory
ls List contents
clear Clear screen

Examples:

1
2
3
cd ~             # go to home
cd ..            # go one level up
cd ~/Documents   # absolute path


๐Ÿงพ Summary of Key Concepts

  • A shell is a command-line interpreter.
  • You can run it locally or over SSH.
  • Prompt tells you where you are and what privileges you have.
  • Commands have names, options (flags), and arguments.
  • Navigation uses standard Unix paths and conventions.

๐Ÿ‘‰ Continue to: Commands and Exit Codes