Adding words (tags) to a file [duplicate]

Multi tool use
Multi tool use









-1















This question already has an answer here:



  • Insert line after first match using sed

    6 answers



I want to add the words "Getting started" to two markdown files (so the extension is .md). They are named:

* installing-disqus.md

* installing-google-analytics.md



I would like to populate that word right after the line "Tags: " so the outcome would be "Tags: Getting started"



In Bash, what command would I write. I am thinking it would look something like this:



echo "Getting started" >> *installing* *Tags:*









share|improve this question















marked as duplicate by shellter bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 23:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Hint: try using sed.
    – user202729
    Nov 10 '18 at 16:22










  • How is this related to keywords?
    – user202729
    Nov 10 '18 at 16:22















-1















This question already has an answer here:



  • Insert line after first match using sed

    6 answers



I want to add the words "Getting started" to two markdown files (so the extension is .md). They are named:

* installing-disqus.md

* installing-google-analytics.md



I would like to populate that word right after the line "Tags: " so the outcome would be "Tags: Getting started"



In Bash, what command would I write. I am thinking it would look something like this:



echo "Getting started" >> *installing* *Tags:*









share|improve this question















marked as duplicate by shellter bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 23:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Hint: try using sed.
    – user202729
    Nov 10 '18 at 16:22










  • How is this related to keywords?
    – user202729
    Nov 10 '18 at 16:22













-1












-1








-1








This question already has an answer here:



  • Insert line after first match using sed

    6 answers



I want to add the words "Getting started" to two markdown files (so the extension is .md). They are named:

* installing-disqus.md

* installing-google-analytics.md



I would like to populate that word right after the line "Tags: " so the outcome would be "Tags: Getting started"



In Bash, what command would I write. I am thinking it would look something like this:



echo "Getting started" >> *installing* *Tags:*









share|improve this question
















This question already has an answer here:



  • Insert line after first match using sed

    6 answers



I want to add the words "Getting started" to two markdown files (so the extension is .md). They are named:

* installing-disqus.md

* installing-google-analytics.md



I would like to populate that word right after the line "Tags: " so the outcome would be "Tags: Getting started"



In Bash, what command would I write. I am thinking it would look something like this:



echo "Getting started" >> *installing* *Tags:*




This question already has an answer here:



  • Insert line after first match using sed

    6 answers







bash echo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 '18 at 16:23







jimmytt

















asked Nov 10 '18 at 16:18









jimmyttjimmytt

19829




19829




marked as duplicate by shellter bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 23:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by shellter bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 23:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Hint: try using sed.
    – user202729
    Nov 10 '18 at 16:22










  • How is this related to keywords?
    – user202729
    Nov 10 '18 at 16:22
















  • Hint: try using sed.
    – user202729
    Nov 10 '18 at 16:22










  • How is this related to keywords?
    – user202729
    Nov 10 '18 at 16:22















Hint: try using sed.
– user202729
Nov 10 '18 at 16:22




Hint: try using sed.
– user202729
Nov 10 '18 at 16:22












How is this related to keywords?
– user202729
Nov 10 '18 at 16:22




How is this related to keywords?
– user202729
Nov 10 '18 at 16:22












1 Answer
1






active

oldest

votes


















0














You could use sed to do a find and replace. Since you want the words added after Tags: (assumming there is only one such line) you could run:



sed -i “s/Tags:/Tags:<your text here>/g” <filename>



-i means that it will do the changes in the file
s/ means it will do a substitution
/
/g do this substitution in the whole file






share|improve this answer




















  • This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
    – jimmytt
    Nov 10 '18 at 16:32











  • You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:35










  • I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
    – jimmytt
    Nov 10 '18 at 16:39











  • Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
    – jimmytt
    Nov 10 '18 at 16:40










  • Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:45

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You could use sed to do a find and replace. Since you want the words added after Tags: (assumming there is only one such line) you could run:



sed -i “s/Tags:/Tags:<your text here>/g” <filename>



-i means that it will do the changes in the file
s/ means it will do a substitution
/
/g do this substitution in the whole file






share|improve this answer




















  • This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
    – jimmytt
    Nov 10 '18 at 16:32











  • You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:35










  • I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
    – jimmytt
    Nov 10 '18 at 16:39











  • Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
    – jimmytt
    Nov 10 '18 at 16:40










  • Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:45















0














You could use sed to do a find and replace. Since you want the words added after Tags: (assumming there is only one such line) you could run:



sed -i “s/Tags:/Tags:<your text here>/g” <filename>



-i means that it will do the changes in the file
s/ means it will do a substitution
/
/g do this substitution in the whole file






share|improve this answer




















  • This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
    – jimmytt
    Nov 10 '18 at 16:32











  • You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:35










  • I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
    – jimmytt
    Nov 10 '18 at 16:39











  • Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
    – jimmytt
    Nov 10 '18 at 16:40










  • Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:45













0












0








0






You could use sed to do a find and replace. Since you want the words added after Tags: (assumming there is only one such line) you could run:



sed -i “s/Tags:/Tags:<your text here>/g” <filename>



-i means that it will do the changes in the file
s/ means it will do a substitution
/
/g do this substitution in the whole file






share|improve this answer












You could use sed to do a find and replace. Since you want the words added after Tags: (assumming there is only one such line) you could run:



sed -i “s/Tags:/Tags:<your text here>/g” <filename>



-i means that it will do the changes in the file
s/ means it will do a substitution
/
/g do this substitution in the whole file







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 '18 at 16:28









Andrei Dumitrescu-TudorAndrei Dumitrescu-Tudor

19719




19719











  • This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
    – jimmytt
    Nov 10 '18 at 16:32











  • You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:35










  • I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
    – jimmytt
    Nov 10 '18 at 16:39











  • Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
    – jimmytt
    Nov 10 '18 at 16:40










  • Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:45
















  • This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
    – jimmytt
    Nov 10 '18 at 16:32











  • You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:35










  • I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
    – jimmytt
    Nov 10 '18 at 16:39











  • Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
    – jimmytt
    Nov 10 '18 at 16:40










  • Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
    – Andrei Dumitrescu-Tudor
    Nov 10 '18 at 16:45















This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
– jimmytt
Nov 10 '18 at 16:32





This is headed in the right direction. How would I do it with two files Andrei? Both files start with "installing" and and in ".md" - "installing-disqus.md" and "installing-google-analytics.md"
– jimmytt
Nov 10 '18 at 16:32













You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
– Andrei Dumitrescu-Tudor
Nov 10 '18 at 16:35




You can use the wildcard operator “*” but better yet read this answer stackoverflow.com/a/10446276/10632970 .
– Andrei Dumitrescu-Tudor
Nov 10 '18 at 16:35












I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
– jimmytt
Nov 10 '18 at 16:39





I am not sure what to do about the error message I got. Here is my attempt: sed -i "s/Tags:/Tags: Getting started/g" installing
– jimmytt
Nov 10 '18 at 16:39













Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
– jimmytt
Nov 10 '18 at 16:40




Here is my error: sed: 1: "installing-disqus.md": command i expects followed by text
– jimmytt
Nov 10 '18 at 16:40












Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
– Andrei Dumitrescu-Tudor
Nov 10 '18 at 16:45




Can you tell me what environment your are using? I tried this command on Ubuntu 18.10 and it worked.
– Andrei Dumitrescu-Tudor
Nov 10 '18 at 16:45



LlFKTZ66ObpyPfmv,rHe80SBrEdCSOKxZP9EuFeLyOc6Ta3 Bo bx
T,g O86re,WkfSEp,8q,aKeA,rRaTBys Sr

Popular posts from this blog

Old paper Canadian currency

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế