Create subfolder within folder in one command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Create subfolder within folder in one command
# 1  
Old 05-28-2012
Create subfolder within folder in one command

suppose if i am checking folder g as shown below path
a/b/c/d/e/f/g ,and some directory c,d,e,f,g not present then is there anyway to create directory in one command
or i need to use mkdir for everyfolder
# 2  
Old 05-28-2012
Hi

Code:
mkdir -p a/b/c

Guru.
This User Gave Thanks to guruprasadpr For This Post:
# 3  
Old 05-28-2012
Create subfolder within folder in one command

and if the end one is a file ?
for eg
/a/b/c/d/e/f.txt
and i want to copy file f.txt to above location and d and e directory missing then
# 4  
Old 05-28-2012
Hi

Code:
mkdir -p /a/b/c/d/e
cp f.txt  /a/b/c/d/e

Guru.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. Shell Programming and Scripting

Create a shared folder using acl

Hello. I need some help to create a shared folder. A group 'publicuser' has been created. A user 'publicuser' has been created ( no login, no home) and belongs to group 'publicuser'. A public folder '/doc' has been created and owner is publicuser:publicuser. All users belonging to group... (12 Replies)
Discussion started by: jcdole
12 Replies

3. Shell Programming and Scripting

Need help in finishing a bash script for listing subfolder by size in a large folder

Greetings everyone. I have seen that you do wonders here. I have a large folder on a Ubuntu linux. Organization main folder, inside 20 000 subfolders, and inside those subolders many other like 5-6 folders and files. I am interested to create an output to a txt file under the bash... (2 Replies)
Discussion started by: ultimo
2 Replies

4. Shell Programming and Scripting

List of files in a folder inclusive subfolder

Hi, I need to list the names of existing files in a specific folder. I have written a script for that, but the problem is, it is also picking up name of a subfolder that is there in that folder. I need only the list of files and not that subfolder. How to go about that ? Can anyone plz help... (2 Replies)
Discussion started by: Subhasis
2 Replies

5. Shell Programming and Scripting

create t a filelist with the latest file by YYYYMMDD and move to subfolder

Hi all, I am receiving files named like: ABC_20120730.csv ABC_20120801.csv ABC_20120812.csv They are residing in a folder named Incoming. I am supposed to write a script that will create a filelist which will contain only the name of the latest file beginning with ABC_, by YYYYMMDD... (3 Replies)
Discussion started by: kedrick
3 Replies

6. UNIX for Dummies Questions & Answers

how to create a command that would print files only from 1 folder

Hi there how to create a command in csh that would print files only from 1 folder but as an argument takes home directory for e.g. in my home diecrtory I have 3 folders unix, windows,mac and alot of files. and I running the program as ./op ~ this should return me files from unix folder without... (1 Reply)
Discussion started by: FUTURE_EINSTEIN
1 Replies

7. Shell Programming and Scripting

Link multiple files from different subfolder to a new subfolder

Hi, I have the following subfolder with files: /data/a/1/xxx.txt /data/b/2/yyy.txt /data/c/3/zzz.txt And i have a set of new folders which have exactly the same structure as above but different disk without the files: /data_02/a/1/ /data_02/b/2/ /data_02/c/3/ Now i would like to... (6 Replies)
Discussion started by: total_ysf
6 Replies

8. Shell Programming and Scripting

how to create folder and sub-folder in UNIX ?

Hi all, I have the following code to check the whether the folder is exist in my system. if ; then echo 'folder exist'; else echo 'folder not exist'; mkdir /home/batch/testing ; fi When I remove the "testing" folder from "/home/batch" directory, the code is working fine. But when I... (2 Replies)
Discussion started by: suigion
2 Replies

9. Shell Programming and Scripting

Command to view folder subfolder and its capacity

Can any one tell how to view folder and subfolder with its capacity df -k will cannot be used it shows only the parent folder while du -k will show all subfolder and files but not show the capacity and also i dont want view any files Thank you!!!! (1 Reply)
Discussion started by: shivu
1 Replies

10. Shell Programming and Scripting

How to read a subfolder one by one in parent folder?

Hi friends, I am getting some trubles in folder reading. I am having 10 subfolders inside server7 folder. i wanna to read a subfolder name first and check if the foldername gets started with "http". if so , i need to read a file inside that folder. This willl continue for... (1 Reply)
Discussion started by: kamatchirajan
1 Replies
Login or Register to Ask a Question