Skip to content
Home » Write-ups » File and directory management in Linux

File and directory management in Linux

Watch the video


Creating a File

touch filename


Removing a File

rm myfile


Opening a File for Editing

nano filename


Copying Files

cp source destination


Moving Files

mv source destination


Wildcards

An * represents any amount of characters
A ? represents any single character


Creating a Backup File

cp filename backupfilename


Renaming a File

mv filename newfilename


Creating Directories

mkdir dirname


Removing Directories

rmdir dirname


Removing Directories Recursively

rm -r dirname


Important Switches to Remember

-v verbose 
-i interactive
-r recursive
-p create parents
cp -v -r -i
rm -v -r -i
mv -v -i
mkdir -v -p

Leave a Reply

Your email address will not be published. Required fields are marked *