How to combine 4 commands into 1 in terminal while they are connected logicallyHow do I combine multiple grep commands?Rerun previous command under sudo12.04 Booting into TerminalHow to combine multiple commands in terminal?Why are none of my startup commands being executed?Combine 2 commands into 1 Custom command?Combine two commands into one commandSending Raw Commands to Connected PrnterCombine consecutive commands into script and run in MAC terminalFiltering Terminal Output and Writing to File

Bullying boss launched a smear campaign and made me unemployable

Mathematica command that allows it to read my intentions

Avoiding the "not like other girls" trope?

Different meanings of こわい

How could indestructible materials be used in power generation?

How can I prove that a state of equilibrium is unstable?

Did 'Cinema Songs' exist during Hiranyakshipu's time?

What Exploit Are These User Agents Trying to Use?

Does int main() need a declaration on C++?

How dangerous is XSS

Car headlights in a world without electricity

Could the museum Saturn V's be refitted for one more flight?

Can I hook these wires up to find the connection to a dead outlet?

What is the most common color to indicate the input-field is disabled?

Placement of More Information/Help Icon button for Radio Buttons

Implication of namely

Why didn't Boeing produce its own regional jet?

Knowledge-based authentication using Domain-driven Design in C#

What is the opposite of "eschatology"?

Send out email when Apex Queueable fails and test it

Convert seconds to minutes

how do we prove that a sum of two periods is still a period?

What is an equivalently powerful replacement spell for Yuan-Ti's Suggestion spell?

Can someone clarify Hamming's notion of important problems in relation to modern academia?



How to combine 4 commands into 1 in terminal while they are connected logically


How do I combine multiple grep commands?Rerun previous command under sudo12.04 Booting into TerminalHow to combine multiple commands in terminal?Why are none of my startup commands being executed?Combine 2 commands into 1 Custom command?Combine two commands into one commandSending Raw Commands to Connected PrnterCombine consecutive commands into script and run in MAC terminalFiltering Terminal Output and Writing to File













-2















can someone help me? Have a H/w from my university. I have to put this 4 commands into 1:



grep - r - l 'TODO'
ln - s test *(It`s the name of file that I get after fisrt command)* softlink
grep -v -r -l 'TODO'
chmod 0644 lab *(It`s the name of file that I get after previous command)*


I tried to google this question but all I get was some stuff with ';' and '&'
But as I understood, it doens`t work in a proper way cause this commands are connected logicaly (I get the name of the file with which I have to work only after 'grep')









share







New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

    – Bob91
    1 hour ago











  • Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

    – Ryan J. Yoder
    1 hour ago















-2















can someone help me? Have a H/w from my university. I have to put this 4 commands into 1:



grep - r - l 'TODO'
ln - s test *(It`s the name of file that I get after fisrt command)* softlink
grep -v -r -l 'TODO'
chmod 0644 lab *(It`s the name of file that I get after previous command)*


I tried to google this question but all I get was some stuff with ';' and '&'
But as I understood, it doens`t work in a proper way cause this commands are connected logicaly (I get the name of the file with which I have to work only after 'grep')









share







New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

    – Bob91
    1 hour ago











  • Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

    – Ryan J. Yoder
    1 hour ago













-2












-2








-2








can someone help me? Have a H/w from my university. I have to put this 4 commands into 1:



grep - r - l 'TODO'
ln - s test *(It`s the name of file that I get after fisrt command)* softlink
grep -v -r -l 'TODO'
chmod 0644 lab *(It`s the name of file that I get after previous command)*


I tried to google this question but all I get was some stuff with ';' and '&'
But as I understood, it doens`t work in a proper way cause this commands are connected logicaly (I get the name of the file with which I have to work only after 'grep')









share







New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












can someone help me? Have a H/w from my university. I have to put this 4 commands into 1:



grep - r - l 'TODO'
ln - s test *(It`s the name of file that I get after fisrt command)* softlink
grep -v -r -l 'TODO'
chmod 0644 lab *(It`s the name of file that I get after previous command)*


I tried to google this question but all I get was some stuff with ';' and '&'
But as I understood, it doens`t work in a proper way cause this commands are connected logicaly (I get the name of the file with which I have to work only after 'grep')







command-line grep





share







New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share







New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share



share






New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









JekopJekop

1




1




New contributor




Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jekop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

    – Bob91
    1 hour ago











  • Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

    – Ryan J. Yoder
    1 hour ago

















  • to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

    – Bob91
    1 hour ago











  • Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

    – Ryan J. Yoder
    1 hour ago
















to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

– Bob91
1 hour ago





to filter output using grep you can type e.g ls -la | grep 'myfile.txt'

– Bob91
1 hour ago













Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

– Ryan J. Yoder
1 hour ago





Could you elaborate a bit on what you are trying to do? It appears you are trying to search for a file with "TODO" in the file, then symlink that file to a file called "softlink". And finally change the permissions? Is that correct?

– Ryan J. Yoder
1 hour ago










1 Answer
1






active

oldest

votes


















0














You can use the pipe '|' to use the output of the first command as the input for the second command like this:



# <first command> | <second command> ...





share|improve this answer























  • This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

    – steeldriver
    1 hour ago












  • @streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

    – Bob91
    1 hour ago











  • If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

    – steeldriver
    1 hour ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Jekop is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130731%2fhow-to-combine-4-commands-into-1-in-terminal-while-they-are-connected-logically%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You can use the pipe '|' to use the output of the first command as the input for the second command like this:



# <first command> | <second command> ...





share|improve this answer























  • This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

    – steeldriver
    1 hour ago












  • @streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

    – Bob91
    1 hour ago











  • If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

    – steeldriver
    1 hour ago















0














You can use the pipe '|' to use the output of the first command as the input for the second command like this:



# <first command> | <second command> ...





share|improve this answer























  • This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

    – steeldriver
    1 hour ago












  • @streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

    – Bob91
    1 hour ago











  • If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

    – steeldriver
    1 hour ago













0












0








0







You can use the pipe '|' to use the output of the first command as the input for the second command like this:



# <first command> | <second command> ...





share|improve this answer













You can use the pipe '|' to use the output of the first command as the input for the second command like this:



# <first command> | <second command> ...






share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









Bob91Bob91

3861311




3861311












  • This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

    – steeldriver
    1 hour ago












  • @streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

    – Bob91
    1 hour ago











  • If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

    – steeldriver
    1 hour ago

















  • This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

    – steeldriver
    1 hour ago












  • @streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

    – Bob91
    1 hour ago











  • If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

    – steeldriver
    1 hour ago
















This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

– steeldriver
1 hour ago






This is only really helpful when <first command> produces standard output, and <second command> consumes standard input (I don't think that's the case for ln or chmod for example: both need filename arguments)

– steeldriver
1 hour ago














@streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

– Bob91
1 hour ago





@streeldriver why not ? If it is hard to handle the heavy output he can use a python command line python -c .... to handle it... i think...

– Bob91
1 hour ago













If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

– steeldriver
1 hour ago





If you did want to use a pipe, the simplest way would be to use xargs to turn stdin into an argument list

– steeldriver
1 hour ago










Jekop is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Jekop is a new contributor. Be nice, and check out our Code of Conduct.












Jekop is a new contributor. Be nice, and check out our Code of Conduct.











Jekop is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130731%2fhow-to-combine-4-commands-into-1-in-terminal-while-they-are-connected-logically%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap

Where is the suspend/hibernate button in GNOME Shell? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)No suspend option in UI on Bionic BeaverHow can I set sleep mode in ubuntu18.04 LTS and what is the short cut key to do so?17.10 suspend not availableUbuntu 18.04 LTS missing sleep optionUbuntu 18.04 LTS - missing suspend option when power button is pressedHow to put Thinkpad X1 Extreme to sleep in Ubuntu 18.10?Suspend Button in interactive power button menu18.04 - Keep programs running after logging outway to disable Hibernate from within gconf-editor so button disappears?How can I hibernate from GNOME Shell?How can I hibernate/suspend from the command line and do so at a specific timeNo permission to suspend/hibernate after upgrading to 12.10MATE - Missing Suspend and Hibernate buttons, pressing power button shutdowns system immediatelyUbuntu 14.04: Suspend, Hibernate and Suspend-hybrid in the menu?Change “power-button-action” comand for “hibernate” option in GNOME 3.18Shutdown / Power off button does always go to suspend on 17.10Hibernate after suspend stopped working in 17.10Why doesn't the keyboard screenshot button work on Ubuntu with GNOME shell?