I need help with mkdir


#1

please help me with mkdir


#2

@digitalcoder83231,
As you start the exercise, you are positioned in the =blog= directory as pwd shows

$ pwd
/home/ccuser/workspace/blog                                                                             

$ cd 2015/feb/                                                                                          
$ pwd                                                                                                   
/home/ccuser/workspace/blog/2015/feb                                                                    
$ ls -als                                                                                               
total 12                                                                                                
4 drwxr-xr-x 3 ccuser ccuser 4096 Jun 20  2015 .                                                        
4 drwxr-xr-x 4 ccuser ccuser 4096 Jun  9  2015 ..                                                       
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 circuit-board.txt                                        
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 input-output.txt                                         
4 drwxr-xr-x 2 ccuser ccuser 4096 Jun 20  2015 media                                                    
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 power-supply.txt

As you can see with
4 drwxr-xr-x 2 ccuser ccuser 4096 Jun 20 2015 media
media is a directory which already exists.....
We will rename this media-directory into a temp-directory
with

mv media/ temp/                                                                                       

$ ls -als                                                                                               
total 12                                                                                                
4 drwxr-xr-x 3 ccuser ccuser 4096 Feb 11 00:27 .                                                        
4 drwxr-xr-x 4 ccuser ccuser 4096 Jun  9  2015 ..                                                       
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 circuit-board.txt                                        
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 input-output.txt                                         
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 power-supply.txt                                         
4 drwxr-xr-x 2 ccuser ccuser 4096 Jun 20  2015 temp

Now we create a =new= media-directory

 mkdir media                                                                                           
$ ls -als                                                                                               
total 16                                                                                                
4 drwxr-xr-x 4 ccuser ccuser 4096 Feb 11 00:28 .                                                        
4 drwxr-xr-x 4 ccuser ccuser 4096 Jun  9  2015 ..                                                       
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 circuit-board.txt                                        
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 input-output.txt                                         
4 drwxr-xr-x 2 ccuser ccuser 4096 Feb 11 00:28 media                                                    
0 -rw-r--r-- 1 ccuser ccuser    0 Jun  9  2015 power-supply.txt                                         
4 drwxr-xr-x 2 ccuser ccuser 4096 Jun 20  2015 temp

The media-directory now exists.....
If we try to create the media-directory once more
we will run into an error

$ mkdir media                                                                                           
mkdir: cannot create directory ‘media’: File exists

Question 6 cdii: mkdir