4.8 Making Directories Made EasierIn article 4.7 , we told you that you should have lots of directories. Experienced UNIX users are creating new directories all the time. How do you make a directory? It's easy. Use the mkdir command, followed by the name of your new directory:
% This creates the new directory you want. It doesn't necessarily have to be in your current directory. For example:
% The only requirements are:
% This tells mkdir to create all the intermediate directories that are needed. So the above command creates three directories:
[If your mkdir doesn't have -p , you can use csh or bash history ( 11.2 ) :
% That's almost as quick. -JP ] If you are using System V, you can also supply the "file protection mode" to be assigned to the directory. (By default, the file protection mode is derived from your umask ( 22.4 ) .) To do so, use the -m option. For example:
% This creates the directory with access mode 755, which allows the owner to do anything with the directory. Note that this must be a numeric mode; see article 22.1 for an introduction to file and directory protection. - |
|