Sponsored Content
Top Forums Shell Programming and Scripting How to create a long list of directories with mkdir? Post 303007773 by setub on Tuesday 21st of November 2017 10:59:31 AM
Old 11-21-2017
How to create a long list of directories with mkdir?

Hi...

Thanks to read this...

I want to use mkdir to create many directories listed in a text file, let's say.

How do I do this?

Sorry for this maybe very basic question Smilie
 

9 More Discussions You Might Find Interesting

1. AIX

mkdir: A file or path name is too long

Hi, I have an AIX machine. I am trying to create a directory from within the script, but the message being shown is "mkdir: 0653-358 Cannot create directory 'xxx': A file or path name is too long" I am not giving any 'long' pathname to mkdir. The commands being issued within the script are: ... (0 Replies)
Discussion started by: greenhorn007
0 Replies

2. UNIX and Linux Applications

mkdir: cannot create directory

Hi, I have network mount on two servers. One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number! Creation, name start with a number: $ mkdir 1212 mkdir: cannot create directory `1212': No such... (12 Replies)
Discussion started by: ./hari.sh
12 Replies

3. Shell Programming and Scripting

Create unique tar archives from a list of directories

I'm looking to archive a client directory from a CIFS share There are multiple directories that will be stored in a text file and I'm looking to create an individual tar archive of each folder in the directory. I've tried a number of commands to no avail. Here's what I would like. ... (2 Replies)
Discussion started by: Steelysteel
2 Replies

4. Shell Programming and Scripting

Need Help Moving Long List Of Files Into Directories

I am very new to BASH and I am having difficulties moving a long list of image files into similarly named directories. I've been trying to come with a script all night and no luck. Here is what my list of files looks like: DSC_0059_01.jpg DSC_0059_02.jpg DSC_0059_03.jpg DSC_0059_04.jpg... (5 Replies)
Discussion started by: jowens1138
5 Replies

5. UNIX for Dummies Questions & Answers

Mkdir a/b/c # where a/b does not exists. is it possible to create it ?

Is is possible to create the directories in following manner. for example my home dir is empty and i want to create dir a/b/c mkdir a/b/c # where a/b does not exists. (5 Replies)
Discussion started by: anandgodse
5 Replies

6. Shell Programming and Scripting

Make directories containing subdirs using mkdir

Hello everybody, I wonder if there's a way to make a directory that contains multiple subdirectories. For example, if I want to make /home/student under the current working directory, how do I do it? Can I do it using a single mkdir command or do I have make home first, cd into it and then make... (1 Reply)
Discussion started by: Yongfeng
1 Replies

7. Shell Programming and Scripting

Scan directories and create a list of files

Gents, Please can you help. I want to create a list which contends the complete patch of the location of some directories with the size of each file. need to select only .txt file In this case I am try to find the subdirectories tp1 and tp2 and create the output list. jd175-1 tp1... (3 Replies)
Discussion started by: jiam912
3 Replies

8. Shell Programming and Scripting

Copy of "How to create a long list of directories with mkdir?"

To bakunin and corona688: My result when text in file is ms_ww_546 ms_rrL_99999 ms_nnn_67_756675 is https://www.unix.com/C:\Users\Fejoz\Desktop\ttt.jpg I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories. ---------- Post... (0 Replies)
Discussion started by: setub
0 Replies

9. Shell Programming and Scripting

Switching between directories and mkdir/copy dir/file

I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/ if n directory is not present at Q2/dir/folder1/expected/ then directory should be created first. And, script follow the... (5 Replies)
Discussion started by: Mannu2525
5 Replies
mkdir(1)						      General Commands Manual							  mkdir(1)

NAME
mkdir - Makes a directory SYNOPSIS
mkdir [-m mode] [-p] directory... STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: mkdir: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Sets the file permissions to mode, a symbolic mode string as defined for chmod, after creating the specified directory. The mode argument can be either an absolute mode string or a symbolic mode string as defined for chmod. See the chmod(1) reference page. In symbolic mode strings, the operation characters + and - are interpreted relative to an assumed initial mode of a=rwx, A + adds permissions to the default mode, whereas a - deletes permissions from the default mode. Creates intermediate directories as neces- sary; otherwise, the full path name prefix to directory must already exist. The user must have mkdir write permission in the parent directory. Each component of directory that does not name an existing directory is created with mode 777, modified by the current file mode creation mask (umask). The equivalent of chmod u+wx is performed on each component to ensure that mkdir can create lower directo- ries regardless of the setting of umask. Each component of directory that names an existing directory is ignored without error. If an intermediate path name component exists, but permissions are set to prevent writing or searching, mkdir fails and returns an error message. The mode argument does not apply to any intermediate directories created when the -p option is specified. OPERANDS
The path name of the directory to be created. DESCRIPTION
The mkdir command creates new directories with read, write, and execute permissions based upon the permissions established by the umask setting. [Tru64 UNIX] The mkdir command also creates the standard entries (dot) for the directory itself and (dot dot) for its parent. NOTES
Some of the requested directories may be created although an error occurs subsequent to the directory creation. If the directory specified by the -p option already exists, the command does not return an error status, in compliance with POSIX.2. [Tru64 UNIX] To make a new directory, you must have write permission in the parent directory. EXIT STATUS
The following exit values are returned: All requested directories were created, or the -p option was used and all of the requested directo- ries now exist. An error occurred. EXAMPLES
To create a new directory called test, enter: mkdir test To set file permissions for new directory test in absolute mode, enter: mkdir -m 444 test To set file permissions for new directory test in symbolic mode, enter: mkdir -m+rw test ENVIRONMENT VARIABLES
The following environment variables affect the execution of mkdir: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: chmod(1), rm(1), rmdir(1), Bourne shell sh(1b), POSIX shell sh(1p), umask(1) Functions: mkdir(2) Standards: standards(5) mkdir(1)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy