Is there a way to create a new directory, containing subdirectories and documents?

Clash Royale CLAN TAG#URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
For web-development practice I'm using a LAMP stack, on Ubuntu 17.10. For this I'm creating directories within /var/www, each directory is named after a project.
To create a subdirectory I use the terminal and:
david@Ed:/var/www/html$ mkdir projectName
david@Ed:/var/www/html$ cd projectName
david@Ed:/var/www/html/projectName$ mkdir css img js
david@Ed:/var/www/html/projectName$ touch index.html
david@Ed:/var/www/html/projectName$ ls
css img index.html js
This works. And, in all honesty, is far from arduous. But, is there a means by which I can simplify this?
I'm aware that:
mkdir -p projectName/css
Will create both the css, and the parent projectName, directory (if that parent doesn't already exist), but it still leaves the requirement of creating the other two directories and the index.html file (again, this is not particularly arduous but feels like it should be unnecessary).
Ideally I'd like that the command mkdir <projectName> when run in the /var/www directory would create the <projectName> directory with the css, img, js directories and the index.html document (that document ideally containing the skeleton of a valid html document*). However I accept that abusing the mkdir command would likely lead to unforeseen/predictable edge-cases and consequences, so probably the best compromise is a script of some kind.
With the above in mind, I created the following (naive/simple) script:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
touch index.html
I call the above script as follows:
./createDir.sh projectName
This works but is less than ideal; the problems:
- the created
index.htmlhas a type ofplain text document (text/plain), rather than the expectedHTML document (text/html), and of course - has none of the structure of an HTML document (as outlined in the single footnote), because I didn't add any content (and haven't yet found a way of creating said content in a script).
Also, somewhat predictably, both the css and js directories would also â ideally â be created with documents (project.css and project.js) intact.
So, is there a means by which I can create â with the use of a script, or otherwise â a directory with its subdirectories and documents?
*. As a rudimentary example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
scripts directory mkdir
add a comment |Â
up vote
0
down vote
favorite
For web-development practice I'm using a LAMP stack, on Ubuntu 17.10. For this I'm creating directories within /var/www, each directory is named after a project.
To create a subdirectory I use the terminal and:
david@Ed:/var/www/html$ mkdir projectName
david@Ed:/var/www/html$ cd projectName
david@Ed:/var/www/html/projectName$ mkdir css img js
david@Ed:/var/www/html/projectName$ touch index.html
david@Ed:/var/www/html/projectName$ ls
css img index.html js
This works. And, in all honesty, is far from arduous. But, is there a means by which I can simplify this?
I'm aware that:
mkdir -p projectName/css
Will create both the css, and the parent projectName, directory (if that parent doesn't already exist), but it still leaves the requirement of creating the other two directories and the index.html file (again, this is not particularly arduous but feels like it should be unnecessary).
Ideally I'd like that the command mkdir <projectName> when run in the /var/www directory would create the <projectName> directory with the css, img, js directories and the index.html document (that document ideally containing the skeleton of a valid html document*). However I accept that abusing the mkdir command would likely lead to unforeseen/predictable edge-cases and consequences, so probably the best compromise is a script of some kind.
With the above in mind, I created the following (naive/simple) script:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
touch index.html
I call the above script as follows:
./createDir.sh projectName
This works but is less than ideal; the problems:
- the created
index.htmlhas a type ofplain text document (text/plain), rather than the expectedHTML document (text/html), and of course - has none of the structure of an HTML document (as outlined in the single footnote), because I didn't add any content (and haven't yet found a way of creating said content in a script).
Also, somewhat predictably, both the css and js directories would also â ideally â be created with documents (project.css and project.js) intact.
So, is there a means by which I can create â with the use of a script, or otherwise â a directory with its subdirectories and documents?
*. As a rudimentary example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
scripts directory mkdir
Related: Create file and its parent directory
â steeldriver
2 hours ago
what is wrong withmkdir -p projectName/css,js,img? Plus you can add a&& touch projectName/index.htmlto create the file, or use acpto copy a index.html to this location.
â Rinzwind
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
1
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
For web-development practice I'm using a LAMP stack, on Ubuntu 17.10. For this I'm creating directories within /var/www, each directory is named after a project.
To create a subdirectory I use the terminal and:
david@Ed:/var/www/html$ mkdir projectName
david@Ed:/var/www/html$ cd projectName
david@Ed:/var/www/html/projectName$ mkdir css img js
david@Ed:/var/www/html/projectName$ touch index.html
david@Ed:/var/www/html/projectName$ ls
css img index.html js
This works. And, in all honesty, is far from arduous. But, is there a means by which I can simplify this?
I'm aware that:
mkdir -p projectName/css
Will create both the css, and the parent projectName, directory (if that parent doesn't already exist), but it still leaves the requirement of creating the other two directories and the index.html file (again, this is not particularly arduous but feels like it should be unnecessary).
Ideally I'd like that the command mkdir <projectName> when run in the /var/www directory would create the <projectName> directory with the css, img, js directories and the index.html document (that document ideally containing the skeleton of a valid html document*). However I accept that abusing the mkdir command would likely lead to unforeseen/predictable edge-cases and consequences, so probably the best compromise is a script of some kind.
With the above in mind, I created the following (naive/simple) script:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
touch index.html
I call the above script as follows:
./createDir.sh projectName
This works but is less than ideal; the problems:
- the created
index.htmlhas a type ofplain text document (text/plain), rather than the expectedHTML document (text/html), and of course - has none of the structure of an HTML document (as outlined in the single footnote), because I didn't add any content (and haven't yet found a way of creating said content in a script).
Also, somewhat predictably, both the css and js directories would also â ideally â be created with documents (project.css and project.js) intact.
So, is there a means by which I can create â with the use of a script, or otherwise â a directory with its subdirectories and documents?
*. As a rudimentary example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
scripts directory mkdir
For web-development practice I'm using a LAMP stack, on Ubuntu 17.10. For this I'm creating directories within /var/www, each directory is named after a project.
To create a subdirectory I use the terminal and:
david@Ed:/var/www/html$ mkdir projectName
david@Ed:/var/www/html$ cd projectName
david@Ed:/var/www/html/projectName$ mkdir css img js
david@Ed:/var/www/html/projectName$ touch index.html
david@Ed:/var/www/html/projectName$ ls
css img index.html js
This works. And, in all honesty, is far from arduous. But, is there a means by which I can simplify this?
I'm aware that:
mkdir -p projectName/css
Will create both the css, and the parent projectName, directory (if that parent doesn't already exist), but it still leaves the requirement of creating the other two directories and the index.html file (again, this is not particularly arduous but feels like it should be unnecessary).
Ideally I'd like that the command mkdir <projectName> when run in the /var/www directory would create the <projectName> directory with the css, img, js directories and the index.html document (that document ideally containing the skeleton of a valid html document*). However I accept that abusing the mkdir command would likely lead to unforeseen/predictable edge-cases and consequences, so probably the best compromise is a script of some kind.
With the above in mind, I created the following (naive/simple) script:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
touch index.html
I call the above script as follows:
./createDir.sh projectName
This works but is less than ideal; the problems:
- the created
index.htmlhas a type ofplain text document (text/plain), rather than the expectedHTML document (text/html), and of course - has none of the structure of an HTML document (as outlined in the single footnote), because I didn't add any content (and haven't yet found a way of creating said content in a script).
Also, somewhat predictably, both the css and js directories would also â ideally â be created with documents (project.css and project.js) intact.
So, is there a means by which I can create â with the use of a script, or otherwise â a directory with its subdirectories and documents?
*. As a rudimentary example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
scripts directory mkdir
asked 3 hours ago
David Thomas
4601615
4601615
Related: Create file and its parent directory
â steeldriver
2 hours ago
what is wrong withmkdir -p projectName/css,js,img? Plus you can add a&& touch projectName/index.htmlto create the file, or use acpto copy a index.html to this location.
â Rinzwind
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
1
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago
add a comment |Â
Related: Create file and its parent directory
â steeldriver
2 hours ago
what is wrong withmkdir -p projectName/css,js,img? Plus you can add a&& touch projectName/index.htmlto create the file, or use acpto copy a index.html to this location.
â Rinzwind
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
1
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago
Related: Create file and its parent directory
â steeldriver
2 hours ago
Related: Create file and its parent directory
â steeldriver
2 hours ago
what is wrong with
mkdir -p projectName/css,js,img? Plus you can add a && touch projectName/index.html to create the file, or use a cp to copy a index.html to this location.â Rinzwind
2 hours ago
what is wrong with
mkdir -p projectName/css,js,img? Plus you can add a && touch projectName/index.html to create the file, or use a cp to copy a index.html to this location.â Rinzwind
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
1
1
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
While this is an imperfect answer, and is mostly produced via some further searches after I posted the question, I've updated my script and solved most of the the problems.
My current script (equally naive and simple though it certainly is) is:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
cat > index.html <<- "EOF"
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
cat > css/project.css <<- "EOF"
*, ::before, ::after
margin: 0;
padding: 0;
box-sizing: border-box;
EOF
cat > js/project.js <<- "EOF"
;
EOF
This feels a little dirty, though it does work. The main issue with this, current, approach is that final cat call:
cat > js/project.js <<- "EOF"
;
EOF
This to produce a document that is correctly identified by its type property as application/javascript, whereas using:
touch js/project.js
Simply creates yet another document â with the correct filetype extension â whose type attribute is plain text document (text/plain).
add a comment |Â
up vote
0
down vote
You'll need some template for your index.html to copy from. But you can create such a template on the fly and then copy it to the desired destination. The install command may be of help:
#!/usr/bin/env bash
template=$(mktemp); # creates a temporary file, usually in /tmp
# Add the HTML code to that temporary file:
cat << EOF > $template
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
# "Install" the file with the given mode
# and create any intermediate directories:
install -m 0644 -D $template /var/www/html/projectName/index.html
# remove the temporary file
rm $template;
exit 0;
You probably need to run this script via sudo because /var/... isn't world-writable.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
While this is an imperfect answer, and is mostly produced via some further searches after I posted the question, I've updated my script and solved most of the the problems.
My current script (equally naive and simple though it certainly is) is:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
cat > index.html <<- "EOF"
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
cat > css/project.css <<- "EOF"
*, ::before, ::after
margin: 0;
padding: 0;
box-sizing: border-box;
EOF
cat > js/project.js <<- "EOF"
;
EOF
This feels a little dirty, though it does work. The main issue with this, current, approach is that final cat call:
cat > js/project.js <<- "EOF"
;
EOF
This to produce a document that is correctly identified by its type property as application/javascript, whereas using:
touch js/project.js
Simply creates yet another document â with the correct filetype extension â whose type attribute is plain text document (text/plain).
add a comment |Â
up vote
0
down vote
While this is an imperfect answer, and is mostly produced via some further searches after I posted the question, I've updated my script and solved most of the the problems.
My current script (equally naive and simple though it certainly is) is:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
cat > index.html <<- "EOF"
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
cat > css/project.css <<- "EOF"
*, ::before, ::after
margin: 0;
padding: 0;
box-sizing: border-box;
EOF
cat > js/project.js <<- "EOF"
;
EOF
This feels a little dirty, though it does work. The main issue with this, current, approach is that final cat call:
cat > js/project.js <<- "EOF"
;
EOF
This to produce a document that is correctly identified by its type property as application/javascript, whereas using:
touch js/project.js
Simply creates yet another document â with the correct filetype extension â whose type attribute is plain text document (text/plain).
add a comment |Â
up vote
0
down vote
up vote
0
down vote
While this is an imperfect answer, and is mostly produced via some further searches after I posted the question, I've updated my script and solved most of the the problems.
My current script (equally naive and simple though it certainly is) is:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
cat > index.html <<- "EOF"
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
cat > css/project.css <<- "EOF"
*, ::before, ::after
margin: 0;
padding: 0;
box-sizing: border-box;
EOF
cat > js/project.js <<- "EOF"
;
EOF
This feels a little dirty, though it does work. The main issue with this, current, approach is that final cat call:
cat > js/project.js <<- "EOF"
;
EOF
This to produce a document that is correctly identified by its type property as application/javascript, whereas using:
touch js/project.js
Simply creates yet another document â with the correct filetype extension â whose type attribute is plain text document (text/plain).
While this is an imperfect answer, and is mostly produced via some further searches after I posted the question, I've updated my script and solved most of the the problems.
My current script (equally naive and simple though it certainly is) is:
#!/bin/bash
mkdir $@
cd $@
mkdir css img js
cat > index.html <<- "EOF"
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
cat > css/project.css <<- "EOF"
*, ::before, ::after
margin: 0;
padding: 0;
box-sizing: border-box;
EOF
cat > js/project.js <<- "EOF"
;
EOF
This feels a little dirty, though it does work. The main issue with this, current, approach is that final cat call:
cat > js/project.js <<- "EOF"
;
EOF
This to produce a document that is correctly identified by its type property as application/javascript, whereas using:
touch js/project.js
Simply creates yet another document â with the correct filetype extension â whose type attribute is plain text document (text/plain).
answered 2 hours ago
David Thomas
4601615
4601615
add a comment |Â
add a comment |Â
up vote
0
down vote
You'll need some template for your index.html to copy from. But you can create such a template on the fly and then copy it to the desired destination. The install command may be of help:
#!/usr/bin/env bash
template=$(mktemp); # creates a temporary file, usually in /tmp
# Add the HTML code to that temporary file:
cat << EOF > $template
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
# "Install" the file with the given mode
# and create any intermediate directories:
install -m 0644 -D $template /var/www/html/projectName/index.html
# remove the temporary file
rm $template;
exit 0;
You probably need to run this script via sudo because /var/... isn't world-writable.
add a comment |Â
up vote
0
down vote
You'll need some template for your index.html to copy from. But you can create such a template on the fly and then copy it to the desired destination. The install command may be of help:
#!/usr/bin/env bash
template=$(mktemp); # creates a temporary file, usually in /tmp
# Add the HTML code to that temporary file:
cat << EOF > $template
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
# "Install" the file with the given mode
# and create any intermediate directories:
install -m 0644 -D $template /var/www/html/projectName/index.html
# remove the temporary file
rm $template;
exit 0;
You probably need to run this script via sudo because /var/... isn't world-writable.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You'll need some template for your index.html to copy from. But you can create such a template on the fly and then copy it to the desired destination. The install command may be of help:
#!/usr/bin/env bash
template=$(mktemp); # creates a temporary file, usually in /tmp
# Add the HTML code to that temporary file:
cat << EOF > $template
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
# "Install" the file with the given mode
# and create any intermediate directories:
install -m 0644 -D $template /var/www/html/projectName/index.html
# remove the temporary file
rm $template;
exit 0;
You probably need to run this script via sudo because /var/... isn't world-writable.
You'll need some template for your index.html to copy from. But you can create such a template on the fly and then copy it to the desired destination. The install command may be of help:
#!/usr/bin/env bash
template=$(mktemp); # creates a temporary file, usually in /tmp
# Add the HTML code to that temporary file:
cat << EOF > $template
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="js/project.js"></script>
<link href="css/project.css" rel="stylesheet" />
</head>
<body></body>
</html>
EOF
# "Install" the file with the given mode
# and create any intermediate directories:
install -m 0644 -D $template /var/www/html/projectName/index.html
# remove the temporary file
rm $template;
exit 0;
You probably need to run this script via sudo because /var/... isn't world-writable.
answered 2 hours ago
PerlDuck
3,0101726
3,0101726
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062388%2fis-there-a-way-to-create-a-new-directory-containing-subdirectories-and-document%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Related: Create file and its parent directory
â steeldriver
2 hours ago
what is wrong with
mkdir -p projectName/css,js,img? Plus you can add a&& touch projectName/index.htmlto create the file, or use acpto copy a index.html to this location.â Rinzwind
2 hours ago
@Rinzwind: absolutely nothing is wrong with it, except that I hadn't come across that syntax before and didn't know of its existence. I do like - and hadn't considered - the approach of copying existing template files. Thank you.
â David Thomas
2 hours ago
@DavidThomas well you can also create the file on the fly by doing a "echo content > index.html" ;)
â Rinzwind
2 hours ago
1
I would just like to point out that creating a user with adduser does something similar. For that purpose skeleton is used, which is in fact a template like proposed in some answers. If you make a template/skeleton with all directories and files, the only thing you need is copy (cp -fvr <template> <destination>) after creating a directory for a new project.
â nobody
2 hours ago