KevsRobots Learning Platform
By Kevin McAleer, 2 Minutes

Directories help you organize files on your Raspberry Pi. In this lesson, you’ll learn how to create, remove, copy, and move directories using the command line.
vdir.mkdir.rm and rmdir.cp and mv.The vdir command is used to list directories. For example, to list the contents of the current directory, type:
vdir
This will display a list of files and directories in the current directory. You can also use ls as an alias for vdir.
Create a new directory: Use the mkdir command to create a new directory.
For example, to create a directory named Projects, type:
mkdir Projects
Removing Directories: Use rmdir to remove an empty directory.
rmdir Projects
Removing Non-Empty Directories: Use rm -r to remove a directory and its contents.
rm -r Projects
Copying: Use cp to copy files and directories.
cp example.txt example_copy.txt
cp -r Projects Projects_backup
Moving: Use mv to move or rename files and directories.
mv example.txt Documents/
mv Projects MyProjects
Removing Files: Use rm to delete files.
rm example.txt
| Command | Description |
|---|---|
mkdir |
make directory |
rmdir |
remove directory |
rm -r |
remove recursively |
cp |
copy |
mv |
move |
rm |
remove |
vdir |
verbose directory listing |
In this lesson, you learned how to list, create, remove, copy, and move directories. These commands help you keep your filesystem organized and efficient.
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments