Practical 11
Practical 11
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.
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
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
Syntax:
output:
mv
The mv command is generally used for renaming the files in Linux.
Syntax :
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:
e.g.
$ touch file1
$ touch file1 file 2....
rm
rm <file name>
e.g.
$ rm file1
$ rm file1 file2...
mv
Syntax:
e.g.
$ ls
sample
$ mv sample sample-copy
$ ls
sample-copy