0% found this document useful (0 votes)
30 views4 pages

Practical 11

Uploaded by

omatalkar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Practical 11

Uploaded by

omatalkar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical 9

Basic Linux commands such as creating,renaming and deleating files and directories.Use
command like ‘mkdir’, ‘touch’, ‘rm’and ‘mv’.

mkdir
mkdir command allows you to create fresh directories in the terminal itself.

The default syntax is


mkdir <directory name>

The new directory will be created.

For example, if you want to create a directory as “B.SC.-III” then the basic
syntax would be:

mkdir B.SC.-III

In case you want to create another directory inside the main directory
B.SC.-III to store FOSS, you can use the following command to do so. mkdir
GeeksforGeeks/Foss

cd

The cd command is used to change the current directory.

The cd command is used to navigate between directories. It requires either the


full path or the directory name, depending on your current working directory.
If you run this command without any options, it will take you to your home
folder.

1. Pwd
2. Cd B.SC.-III
3. Pwd

Here we used pwd to view the current directory for reference and then we
used cd B.SC.III to switch the directory and with again pwd command we can
see the output is the switched directory, i.e – B.SC.-III
rmdir

The rmdir command is used to delete permanently an empty directory.


The rmdir command is used to delete a directory.

Syntax:

rmdir <directory name>

e.g. rmdir B.Sc.-III

output:

mv
The mv command is generally used for renaming the files in Linux.

Syntax :

mv <file name> <Renamed file name>

e.g. mv first.tet renamed.txt

commnd:

1. ls

2. mv first.tet renamed.txt

3. ls

touch

The touch command is used to create empty files. We can create multiple empty
files by executing it once.

Syntax:

touch <file name>


touch <file1> <file2> ....

e.g.
$ touch file1
$ touch file1 file 2....

rm

The rm command is used to remove a file.


Syntax:

rm <file name>

e.g.

$ rm file1

$ rm file1 file2...

mv

The mv command is used to move a file or a directory form one location to


another location.

Syntax:

mv <file name> <directory path>


or
mv <source> <destination>

e.g.
$ ls
sample
$ mv sample sample-copy
$ ls
sample-copy

You might also like