Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cyber Security Cards › Revision Cards

Working with Files and Directories

Working with Files and Directories Basic commands to create, copy, move and delete files and folders in Linux. mkdir : make a folder. cp : copy. mv : move or rename. rm : delete. Running rm -rf without checking the path. A server has no Recycle Bin . Run ls on the same path first. mkdir -p ~/labs/si

Working with Files and Directories Basic commands to create, copy, move and delete files and folders in Linux. mkdir : make a folder. cp : copy. mv : move or rename. rm : delete. Running rm -rf without checking the path. A server has no Recycle Bin . Run ls on the same path first. mkdir -p ~/labs/si
Working with Files and Directories · Download PNG
Read card text

What this card says

What it is

Basic commands to create, copy, move and delete files and folders in Linux.

Key commands

mkdir: make a folder. cp: copy. mv: move or rename. rm: delete.

Common mistake

Running rm -rf without checking the path.

A server has no Recycle Bin. Run ls on the same path first.

Example

mkdir -p ~/labs/site/css creates the folder and its parents in one step.

CommandPurposeExample
mkdirMake directorymkdir project, mkdir -p a/b/c (create parents)
touchCreate empty file / update timestamptouch index.html
cpCopycp a.txt b.txt, cp -r site/ backup/
mvMove or renamemv old.txt new.txt, mv file.txt /tmp/
rmRemove filerm file.txt, rm -i *.log (ask first)

Learn more in the lesson: 5.3 Working with Files and Directories

See all Ravi Sir's Cyber Security Cards