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.
pwd ls cd /tmp pwd
| Step | Command Typed | Shell Action | Output | Current Directory |
|---|---|---|---|---|
| 1 | pwd | Print current directory | /home/user | /home/user |
| 2 | ls | List files in current directory | Documents Downloads Music | /home/user |
| 3 | cd /tmp | Change directory to /tmp | /tmp | |
| 4 | pwd | Print current directory | /tmp | /tmp |
| 5 | No more commands | /tmp |
| Variable | Start | After 1 | After 2 | After 3 | After 4 | Final |
|---|---|---|---|---|---|---|
| Current Directory | /home/user | /home/user | /home/user | /tmp | /tmp | /tmp |
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
pwdpwd command stands for "print working directory" and shows the current folder path.ls lists files, cd changes directory, and mkdir creates a folder, so they don't show the current directory.pwd -> Option Aprojects?mkdir.mkdir directory_name, so mkdir projects is correct.mkdir projects -> Option Amkdir testdir cd testdir pwd
mkdir testdir creates a folder named testdir. cd testdir moves into that folder. pwd prints the full path of the current directory.pwd will show /home/username/testdir.cd myfolder but get an error: bash: cd: myfolder: No such file or directory. What is the most likely cause?myfolder is not found in the current location.cd is a basic command and usually not misspelled here. Permissions errors give different messages. mkdir creates folders but is not required before cd if the folder exists.myfolder does not exist in the current directory -> Option Bbackup inside your current directory and then move into it. Which sequence of commands will do this correctly?mkdir backup creates the folder named backup in the current directory.cd backup moves you inside that folder.cd backup
mkdir backup tries to cd into backup before it exists, causing an error. mkdir
cd backup misses the folder name in mkdir. cd backup
cd backup tries to cd twice without creating the folder.mkdir backup
cd backup -> Option DPass the test and this pattern moves unknown