First commands
Your First Commands
ls command command to list content of directory
copy command - command for copy file or directory
mkdir command - command to create directory
Let’s run some commands. Type each one and press Enter.
Who Am I?
whoami
This prints your username. The computer is confirming who you’re logged in as.
What Machine Is This?
hostname
This prints the name of the computer you’re connected to. Useful when you’re managing multiple servers.
Where Am I?
pwd
pwd = print working directory. This shows your current location in the file system.
You’ll see something like:
/home/yourusername
This is your home directory - your personal space on the system.
What’s Here?
ls
ls = list. This shows files and folders in your current directory.
If you just installed, it might be empty or show a few default files.
What Time Is It?
date
This prints the current date and time according to the system.
Clean Up the Screen
clear
This clears all the text and gives you a fresh screen. You can also press Ctrl+L as a shortcut.
Challenge
Now try this on your own:
Task: Disconnect from SSH, reconnect, and run all six commands from memory.
-
Type
exitto disconnect from SSH -
Reconnect using
ssh username@ip-address -
Run:
whoami,hostname,pwd,ls,date,clear
Verify: If you can do all of this without looking at notes, you’ve completed Module 1.
Hint:
The SSH command format is:
ssh username@ip-address
Replace username with your actual username and ip-address with the IP you wrote down earlier.
Summary
You just:
-
Created a Linux virtual machine
-
Installed Ubuntu Server
-
Found your VM’s IP address
-
Connected remotely via SSH
-
Ran your first Linux commands
You have a working Linux environment. You typed commands and got results. That’s the foundation everything else builds on.
Next module: We’ll do more things, then explain what’s actually happening.
Definitions
Virtual Machine (VM): A computer simulated in software, running inside your real computer.
Ubuntu: A popular distribution (version) of Linux, known for being beginner-friendly.
SSH (Secure Shell): A protocol for securely connecting to remote computers over a network.
IP Address: A numerical address that identifies a device on a network, like a house number on a street.
Terminal: The text-based interface where you type commands.
Console: Direct access to a machine, as if you were physically sitting at it. In a VM, the console window simulates this.
Home Directory: Your personal folder on a Linux system, usually /home/yourusername.