Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Create 2 directories in one command Post 302893962 by alister on Saturday 22nd of March 2014 12:39:44 PM
Old 03-22-2014
This sounds like homework. If not, please explain why you must use a single command.

Regardless, refer to the mkdir man page.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to create directories

Hi... Can any1 help me by telling me the way to create multiple directories using single command.... to create 1 directory.. mkdir is used.... :D but how to create multiple direcs. like 4 direc. i tried .... $ mkdir a; mkdir b; mkdir c; mkdir d But its 4 commands in a single... (3 Replies)
Discussion started by: abishekmag
3 Replies

2. Programming

Using a C program to create directories in UNIX

Aloha, I'm attempting to use a C program to create directories and then use a system call to have another program write .dat files into that directory. I understand that I could use the "system("mkdir directory_name")" function however, I would like my program to create a new directory each time... (3 Replies)
Discussion started by: aloha_boi
3 Replies

3. UNIX for Advanced & Expert Users

How to create short form for directories?

Hi Friends, Can you please tell me how to create short form for directories? like, this is a directory: /usr/tmp/progs/scripts when i give cd $short_name, it should take to the above path. in which env setting do i have to set? Thanks, Rashmy. (8 Replies)
Discussion started by: smr_rashmy
8 Replies

4. UNIX for Dummies Questions & Answers

How to create shotcuts to the directories

Hi, I need your help in writing shortcuts to my directories. So that I can go into the directories with the help of shortcuts. For example: there is a directory called /home/java/webapps/project1 I want to give a shortcut as project1 . So whenever I have give cd project 1 from command line ... (3 Replies)
Discussion started by: TonySolarisAdmi
3 Replies

5. UNIX for Dummies Questions & Answers

Want to create 3 different new directories under the same path

Hi, Iam new to UNIX...My requirement is to create 3 dir as an hierarchy under /var/opt/temip.The output should be /var/opt/temip/GP_Int/GPTTS/AUTO. I have tried the following script...But only GP_int folder is getting created and not other folders...Can someone help??? #!/usr/bin/ksh #script... (1 Reply)
Discussion started by: Llb
1 Replies

6. UNIX for Dummies Questions & Answers

Create directories from a sql file?

Hi, I have a sql file which has CREATE and INSERT commands in it. Basically, inside this file, a table will be created and the data will be inserted into the table. I was wondering if there is a way for me to create directories from this file? Thanks in advance (4 Replies)
Discussion started by: tezarin
4 Replies

7. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

8. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

9. UNIX for Dummies Questions & Answers

Create multiple directories with awk

Hello all. Newbie here. In a directory, I have 50 files and one additional file that is a list of the names of the 50 files. I would like to create a directory for each of the 50 files, and I need the 50 directory names to correspond to the 50 file names. I know this can be done by running... (6 Replies)
Discussion started by: Zeckendorff
6 Replies

10. Shell Programming and Scripting

Need to create automated Directories

Hi, On serverB i wish to have a script that creates ONLY & EXACTLY the same folder structure that i provide on ServerA. Thus if serverA has a folder "Output" under /opt/app/Output and has the below folders under Output Output Output/logs Output/reciever Output/data... (11 Replies)
Discussion started by: mohtashims
11 Replies
MKDIRAT(2)						     Linux Programmer's Manual							MKDIRAT(2)

NAME
mkdirat - create a directory relative to a directory file descriptor SYNOPSIS
#include <fcntl.h> /* Definition of AT_* constants */ #include <sys/stat.h> int mkdirat(int dirfd, const char *pathname, mode_t mode); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): mkdirat(): Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L Before glibc 2.10: _ATFILE_SOURCE DESCRIPTION
The mkdirat() system call operates in exactly the same way as mkdir(2), except for the differences described in this manual page. If the pathname given in pathname is relative, then it is interpreted relative to the directory referred to by the file descriptor dirfd (rather than relative to the current working directory of the calling process, as is done by mkdir(2) for a relative pathname). If pathname is relative and dirfd is the special value AT_FDCWD, then pathname is interpreted relative to the current working directory of the calling process (like mkdir(2)). If pathname is absolute, then dirfd is ignored. RETURN VALUE
On success, mkdirat() returns 0. On error, -1 is returned and errno is set to indicate the error. ERRORS
The same errors that occur for mkdir(2) can also occur for mkdirat(). The following additional errors can occur for mkdirat(): EBADF dirfd is not a valid file descriptor. ENOTDIR pathname is relative and dirfd is a file descriptor referring to a file other than a directory. VERSIONS
mkdirat() was added to Linux in kernel 2.6.16; library support was added to glibc in version 2.4. CONFORMING TO
POSIX.1-2008. NOTES
See openat(2) for an explanation of the need for mkdirat(). SEE ALSO
mkdir(2), openat(2), path_resolution(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-05-04 MKDIRAT(2)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy