mkdir <dir> | Creates a new directory with the specified name. | mkdir Projects |
mkdir -p <dir>/<dir> | Creates nested directories in a single command. | mkdir -p Work/2023/Reports |
mkdir <dir1> <dir2> <dir3> | Creates multiple directories at once. | mkdir Folder1 Folder2 Folder3 |
mkdir "<dir>" | Creates a folder with spaces in its name. | mkdir "My New Folder" |
rmdir <dir> | Deletes an empty directory. | rmdir OldFolder |
rm -R <dir> | Removes a directory and all of its contents. | rm -R ProjectFolder |
touch <file> | Creates a new, empty file without any extension. | touch newfile.txt |
cp <file> <dir> | Copies a file to a specified directory. | cp file.txt /Documents/ |
cp <file> <newfile> | Copies a file to the current directory and renames it. | cp file.txt newfile.txt |
cp <file>~/<dir>/<newfile> | Copies a file to a specified folder and renames it during the process. | cp report.txt ~/Documents/Reports/summary.txt |
cp -R <dir> <"new dir"> | Copies an entire directory, including its contents, to a new location. | cp -R folder1 "New Folder" |
cp -i <file><dir> | Prompts you for confirmation before overwriting a file during copy. | cp -i file1.txt /Backup/ |
cp <file1> <file2> <file3>/Users/<dir> | Copies multiple files into a directory. | cp file1.txt file2.txt /Users/username/Documents/ |
ditto -V [folder path][new folder] | Copies the contents of one folder to another, with status updates. | ditto -V /Folder1 /Folder2 |
rm <file> | Deletes a specified file permanently. | rm unwantedfile.txt |
rm -i <file> | Deletes a file with a prompt for confirmation. | rm -i oldfile.txt |
rm -f <file> | Forces the deletion of a file without any confirmation. | rm -f tempfile.txt |
rm <file1> <file2> <file3> | Deletes multiple files at once without confirmation. | rm file1.txt file2.txt file3.txt |
mv <file> <newfilename> | Moves or renames a file to a new location or name. | mv oldfile.txt newfile.txt |
mv <file> <dir> | Moves a file to a different directory. | mv file.txt /Documents/Backup/ |
mv -i <file> <dir> | Moves a file to a folder and asks for confirmation before overwriting. | mv -i file1.txt /Documents/Backup/ |
mv *.png ~/<dir> | Moves all PNG files from the current directory to another directory. | mv *.png ~/Pictures/ |