0
0
Linux CLIscripting~10 mins

Home directory (~) and shortcuts in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A/home
B~
C/root
D/usr
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.
2fill in blank
medium

Complete 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'
A/home/user
B/tmp
C/
D~
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.
3fill in blank
hard

Fix 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'
A~/
B/home/
C~
Dhome
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.
4fill in blank
hard

Fill 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'
A~
B/home/user
D/Documents
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.
5fill in blank
hard

Fill 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'
A~
D/backup
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.