The shell and the prompt · Shell và dấu nhắc
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
English
The prompt
- When the terminal is ready, it shows a prompt and waits:
- That tells you who you are (
student), the computer (linux), and the folder you are in (~, your home). - You type a command after the
$, press Enter, and the computer runs it.
Tiếng Việt
Dấu nhắc lệnh
- Khi terminal sẵn sàng, nó hiển thị một prompt (dấu nhắc) và chờ:
student@linux:~$
- Điều đó cho bạn biết ai là bạn (
student), máy tính (linux), và thư mục bạn đang ở (~, thư mục cá nhân của bạn). - Bạn gõ lệnh sau dấu
$, nhấn Enter, và máy tính sẽ thực thi nó.
English
Where am I?
- The command
pwdprints your current folder — your "you are here" on the map:
- Press the ▶ on that example to try it. (
~is short for your home folder,/home/student.)
Tiếng Việt
Tôi đang ở đâu?
- Lệnh
pwdin ra thư mục hiện tại của bạn — "bạn đang ở đây" trên bản đồ:
pwd
- Nhấn ▶ vào ví dụ này để thử. (
~là viết tắt của thư mục cá nhân của bạn,/home/student.)
English
Make the computer talk
echosimply prints back what you type. It is the classic first command:
- Run it, then try the two tasks below.
Tiếng Việt
Làm cho máy tính giao tiếp
echođơn giản chỉ in lại những gì bạn gõ. Đó là lệnh đầu tiên kinh điển:
echo Hello from the shell
- Chạy nó, sau đó thử hai nhiệm vụ dưới đây.
English
Common mistakes
- Commands are case-sensitive:
LSis notls. - The shell runs one command per line when you press Enter.
Tiếng Việt
Lỗi thường gặp
- Các lệnh phân biệt chữ hoa/thường:
LSkhác vớils. - Shell thực thi một lệnh mỗi dòng khi bạn nhấn Enter.
The prompt is waiting for a command. Type pwd (print working directory) to see which folder you are in, then click Run. · Dấu nhắc đang chờ một lệnh. Gõ pwd (print working directory) để xem bạn đang ở thư mục nào, sau đó nhấn Run.
echo prints back whatever you give it. Use it to print the word hello. · echo in lại bất cứ cái gì bạn đưa vào. Dùng nó để in từ hello.