0
0
Linux CLIscripting~10 mins

First Linux commands in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - First Linux commands
Open Terminal
Type Command
Press Enter
Shell Executes Command
Output Displayed
Ready for Next Command
This flow shows how you open a terminal, type a Linux command, press Enter, and see the output.
Execution Sample
Linux CLI
pwd
ls
cd /tmp
pwd
This sequence shows checking current directory, listing files, changing directory, and checking again.
Execution Table
StepCommand TypedShell ActionOutputCurrent Directory
1pwdPrint current directory/home/user/home/user
2lsList files in current directoryDocuments Downloads Music/home/user
3cd /tmpChange directory to /tmp/tmp
4pwdPrint current directory/tmp/tmp
5No more commands/tmp
💡 No more commands to execute, session waits for next input.
Variable Tracker
VariableStartAfter 1After 2After 3After 4Final
Current Directory/home/user/home/user/home/user/tmp/tmp/tmp
Key Moments - 2 Insights
Why does the output of 'pwd' change after 'cd /tmp'?
Because 'cd /tmp' changes the current directory to /tmp, so the next 'pwd' shows the new location (see execution_table rows 3 and 4).
Why does 'ls' show files only from the current directory?
'ls' lists files in the directory you are currently in, which is /home/user before 'cd /tmp' (see execution_table row 2).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the current directory after step 3?
A/tmp
B/home/user
C/root
D/var
💡 Hint
Check the 'Current Directory' column at step 3 in the execution_table.
At which step does the output of 'pwd' show '/home/user'?
AStep 1
BStep 4
CStep 3
DStep 2
💡 Hint
Look at the 'Output' column for 'pwd' commands in the execution_table.
If we run 'cd /var' instead of 'cd /tmp' at step 3, what would be the output of 'pwd' at step 4?
A/tmp
B/var
C/home/user
D/root
💡 Hint
Changing directory changes the output of 'pwd' to the new directory (see key_moments explanation).
Concept Snapshot
First Linux commands:
- Open terminal
- Type commands like pwd, ls, cd
- Press Enter to run
- pwd shows current folder
- ls lists files there
- cd changes folder
- Output shows results immediately
Full Transcript
This lesson shows how to use basic Linux commands in a terminal. First, you open the terminal and type a command like pwd to see your current folder. Then, you can list files with ls. To move to another folder, use cd followed by the folder path. After changing folders, pwd shows the new location. Each command runs when you press Enter, and the shell shows the output. This helps you navigate and see files on your computer using simple commands.