Essential File System Management Tasks

 

In this article, we are going to look at some File System Management Essential Tasks.

#pwd – Print the working directory. By running this command you can see the path where you are currently in a Linux system.

Example,

[root@server1 ~]$ pwd
/home/john/
[root@server1 ~]$

Here presently you’re in the home directory of a user john.

#touch – This command will create the zero byte text file in a Linux System.

Example,

[root@server1 ~]$ touch testfile
[root@server1 ~]$ ls
testfile
[root@server1 ~]$

Here you’re creating a file name called testfile by using touch. You can see the file by running ls command.
The ls command used to listing the files/directories in the system.

#mkdir – The mkdir stands for make directory. Which is used to create a new directory on the server.

[root@server1 ~]$ mkdir finance
[root@server1 ~]$ ls
finance
[root@server1 ~]$

Here you’re creating a new directory name called finance.

#cp – The cp stands of copy. By using cp command you can copy the files and directory from one location to another location on the server.

Example,

[root@server1 ~]$ cp /etc/hosts /home/john/
[root@server1 ~]$ cd /home/john/
[root@server1 ~]$ ls
hosts
[root@server1 ~]$ pwd
/home/john/
[root@server1 ~]$ cp --help

Here you’re copying the file (/etc/hosts) to home directory of john (/home/john/). The syntax is cp <source> <destination> and you can see some more interesting options by using –help.

 

 

Related posts

Leave a Comment