DEV Community

Sourav Dhiman
Sourav Dhiman

Posted on

Linux Basic Commands you need to know!

ls

Displays the contents of a directory. (List)

~ ls [directory]... [FILE]...
Enter fullscreen mode Exit fullscreen mode

cd

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files. (Change Directory)

~ cd [directory]...
Enter fullscreen mode Exit fullscreen mode

mkdir

Used to make a new directory. (Make Directory)

~ mkdir [directory]...
Enter fullscreen mode Exit fullscreen mode

pwd

Shows the exact path to the current directory you are in. (Path to Working Directory)

~ pwd
Enter fullscreen mode Exit fullscreen mode

touch

Used to make a new file of any kind.

~ touch [file]
Enter fullscreen mode Exit fullscreen mode

rm/rmdir

Used to remove files and directories.
rm for files: (Remove)

~ rm [Optional]...[file]...
Enter fullscreen mode Exit fullscreen mode

rmdir for directories: (Remove Directory)

~ rmdir [directory]
Enter fullscreen mode Exit fullscreen mode

mv

Used to move files and directories. (Move)

~ mv [file]...[directory]
Enter fullscreen mode Exit fullscreen mode

cp

Used to copy files and directories.
cp for files: (Copy)

~ cp [Optional]...[file]... [directory]...
Enter fullscreen mode Exit fullscreen mode

cp -R for directories:

~ cp -R [directory]... [directory]...
Enter fullscreen mode Exit fullscreen mode

.
.
.
Resource
.
.
.

Top comments (0)