OS Lab 2
OS Lab 2
Roll No – 2300291530130
Sec – V
Branch – CSE(AI&ML)
1. ls Command
Explanation:
ls is used to list files and folders in a directory. It shows what’s inside a
folder.
Syntax:
ls [options] [directory_or_path]
2.pwd Command
Explanation:
pwd (print working directory) tells you the full path of your current
location in the file system.
Syntax:
pwd [options]
3.cd Command
Explanation:
cd (change directory) allows you to navigate between folders.
Syntax:
cd [directory_path]
Syntax:
mkdir [options] directory_name
5. rmdir Command
Explanation:
rmdir (remove directory) deletes empty directories only
Syntax:
rmdir [options] directory_name
How to Delete a Non-Empty Directory? -> rm -r mydir
6. rm Command
Explanation:
rm (remove) deletes files or directories. Be cautious as it permanently
removes them.
Syntax:
rm [options] file_or_directory
7.cp Command
Explanation:
cp (copy) is used to copy files and directories from one location to
another
Syntax:
cp [options] source target
8.mv Command
Explanation:
mv (move) moves files and directories, and it can also be used to
rename them
Syntax:
mv source target
9. touch Command
Explanation:
touch creates an empty file or updates the timestamp of an existing
file
Syntax:
touch file_name