Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to change directory to your home folder using the shortcut.
Linux CLI
cd [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using /home instead of ~ does not always point to your personal home directory.
Using /root is the home directory for the root user, not your user.
✗ Incorrect
The tilde (~) is a shortcut for the current user's home directory in Linux.
2fill in blank
mediumComplete the command to list all files, including hidden ones, in your home directory using the shortcut.
Linux CLI
ls -a [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using /home/user may not work if your username is different.
Using /tmp or / root lists files outside your home directory.
✗ Incorrect
Using ~ points to your home directory, so ls -a ~ lists all files including hidden ones there.
3fill in blank
hardFix the error in the command to copy a file named 'notes.txt' from your home directory to /tmp using the home shortcut.
Linux CLI
cp [1]/notes.txt /tmp/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'home' without a slash is not recognized as a path.
Using '~/ ' with a space or extra slash can cause errors.
✗ Incorrect
The tilde (~) alone expands to your home directory. Adding a slash after it is optional but can cause issues if not used carefully.
4fill in blank
hardFill both blanks to create a command that moves all '.txt' files from your home directory to the Documents folder inside it.
Linux CLI
mv [1]/*.txt [2]/Documents/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using absolute paths like /home/user may not work if username differs.
Using /Documents alone points to root Documents folder, not inside home.
✗ Incorrect
Using ~ for both source and destination paths correctly points to your home directory and its Documents folder.
5fill in blank
hardFill all three blanks to create a command that creates a backup directory named 'backup' inside your home directory and copies all '.conf' files there.
Linux CLI
mkdir [1]/backup && cp [2]/*.conf [3]/backup/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using /backup alone creates or copies to a folder in root, not home.
Mixing absolute and relative paths can cause errors.
✗ Incorrect
Using ~ for all paths ensures the commands work inside your home directory and its backup folder.