Pages

Thursday, June 1, 2017

4 Useful Tips on mkdir, tar and kill Commands in Linux

We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our Linux Tips and Trick Series, I am here with the below four tips that will going to help you in lots of ways. Here we go!
Linux Useful Tips
4 Linux Useful Tips and Hacks
1. You are supposed to create a long/complex directory tree similar to given below. What is the most effective way to achieve this?
Directory tree structure to achieve as suggested below.

$ cd /home/$USER/Desktop
$ mkdir tecmint
$ mkdir tecmint/etc
$ mkdir tecmint/lib
$ mkdir tecmint/usr
$ mkdir tecmint/bin
$ mkdir tecmint/tmp
$ mkdir tecmint/opt
$ mkdir tecmint/var
$ mkdir tecmint/etc/x1
$ mkdir tecmint/usr/x2
$ mkdir tecmint/usr/x3
$ mkdir tecmint/tmp/Y1
$ mkdir tecmint/tmp/Y2
$ mkdir tecmint/tmp/Y3
$ mkdir tecmint/tmp/Y3/z
The above scenario can simply be achieved by running the below 1-liner command.
$ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var}
To verify you may use tree command. If not installed you may apt or yum the package ‘tree‘.

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n46Cv
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment