> For the complete documentation index, see [llms.txt](https://blog.syselement.com/tcm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.syselement.com/tcm/courses/linux-101/2-command-line/intro-to-commandline.md).

# Intro to Command Line

## Command Prompt

* First item in the prompt is a line representing the **user name**, followed by the "**`@`**" sign, the computer **host name**, a colon "**`:`**", the current working directory and the "**`$`**" sign.

```bash
user@ubuntuVM:~$
# current_user @ host_name : current_working_directory $
# user = current_user
# ubuntuVM = hostname
# ~ = user's home directory
# $ = logged in as a normal user

root@ubuntuVM:/home/user#
# # = logged in as the root user
```

### whoami

* **`whoami`** - Returns the user name of the current user

```bash
user@ubuntuVM:~$ whoami
	user
```

* Note **Linux is case-sensitive**, so the commands are too.

### hostname

* **`hostname`** - Returns the name of the current host

```bash
user@ubuntuVM:~$ hostname
	ubuntuVM
```

### pwd

* **`pwd`** - Print working directory

```bash
user@ubuntuVM:~$ pwd
	/home/user

# ~ is shorthand for the home directory
```

### ls

* **`ls`** - List the contents of a directory

```bash
user@ubuntuVM:~$ ls
	Desktop  Documents  Downloads  Music  Pictures  Public  snap  Templates  Videos
```

### cd

* **`cd`** - Change working directory

```bash
user@ubuntuVM:~$ cd Downloads
user@ubuntuVM:~/Downloads$
# the current working directory changed

user@ubuntuVM:~/Downloads$ cd ..
# to go back to the parrent directory
user@ubuntuVM:~$
```

> 📌 Use only **`cd`** to go back to the current user's home directory

```bash
user@ubuntuVM:~$ cd /tmp/
user@ubuntuVM:/tmp$ cd
user@ubuntuVM:~$
```

![](/files/sf7M2aI4uUNUNCN0Akfo)

### alias

* **`alias`** - list bash aliases

```bash
alias
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l='ls -CF'
    alias la='ls -A'
    alias ll='ls -alF'
    alias ls='ls --color=auto'
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://blog.syselement.com/tcm/courses/linux-101/2-command-line/intro-to-commandline.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
