Linux | Change, Create, Remove, Move & Rename Directories

Опубликовано: 25 Сентябрь 2026
на канале: Hacker Suhel
127
4

0:29 cd /etc
0:53 cd -
1:37 mkdir
1:56 ls -ld
2:30 mkdir -p
2:37 tree
3:05 rmdir
3:28 rmdir
3:53 rm -rf
5:50 cp ~/
6:15 test ~/
7:06 mv

cd – Change Directory
cd /etc # go to /etc
cd .. # up one level
cd ~ # to your home
cd - # back to previous location

pwd – Print Working Directory
Shows your current absolute path.
pwd
________________________________________
2.3 Creating and Managing Directories
mkdir – Make Directory
mkdir Projects
mkdir -p Projects/2025/January
-p creates intermediate directories automatically.
________________________________________
rmdir – Remove Empty Directories
rmdir OldFolder
Works only if the directory is empty.
________________________________________
rm – Remove Files or Directories
rm file.txt
rm -r folder/ # remove directory recursively
rm -f file.txt # force delete (no prompt)
rm -rf /test # recursive + force
Be careful with rm -rf / – it will erase everything.
________________________________________
2.4 File Creation and Manipulation
touch – Create Files or Update Timestamp
touch notes.txt
cp – Copy Files and Folders
cp file1 file2
cp -r source/ destination/
Options: -v (verbose), -i (confirm overwrite).
mv – Move or Rename
mv old.txt new.txt
mv report.docx ~/Documents/