Linked Questions

0
votes
1answer
3k views

Semicolon or double ampersand for chaining commands? [duplicate]

When writing a bash script, which is better to chain commands, a semicolon ; or double ampersand &&?
2
votes
1answer
891 views

How to chain make command with git clone? [duplicate]

I want to automate pulling git repo and building that repo unattended. Is there any way I can clone repository and run make immediately after running git clone? Something like: git clone << ...
0
votes
1answer
466 views

Script with commands split & cat [duplicate]

I want to split an image.jpg into parts and merge it again. I used the following commands: split -b 1440 image.jpg # It divides it into 6 parts. cat xaa.jpg xab.jpg xac.jpg xad.jpg xae.jpg xaf.jpg &...
22
votes
3answers
51k views

How to execute several commands after each other with one request to the terminal (without using a file)?

I could (1) prepare a file with typed commands seperated by end-line, (2) make it executable, (3) run it from a file-system manager or the terminal. But this is ridiculous for not repeatable and ...
24
votes
2answers
56k views

How to combine multiple commands in terminal?

I have the following commands. cd import zcat urls1.sql.gz | mysql -u root -p urls cd /var/www/project1/ nano 1.php As of now I'm executing it one by one. Is there a way to combine those commands ...
10
votes
2answers
17k views

How can I run multiple commands which have & in one command line?

I've encountered a headache problem. I want to execute mulitple commands in background, so I want to start them in bash one by one. It's easy to start one command in linux shell in background, just ...
9
votes
1answer
6k views

Run two commands in case of || or &&

I have read about && and || and I'd like to run two commands in the false case. I have tried ; but that is running always. I have tried putting it in curly braces { command1; command2 } but ...
6
votes
4answers
4k views

How to start two Ubuntu applications in one go?

Lets suppose that there are two binary files, e.g. XXX and YYY, at destination /usr/bin/. I want to start them at once, always! In other words, when I type the name of either of those in unity, I want ...
4
votes
1answer
3k views

How do I recursively zip all subfolders in a directory?

Currently, I have this directory structure: /Downloads /Download 1/ /Download 2/ /Download 3/ ... I would like to have this directory structure: /Downloads Download 1.zip ...
2
votes
1answer
198 views

What are the steps of this command using ; || and &&

Note: A B C are commands..... Please tell what the step process would be of these commands A || B && C = A && B ; C = What I am really after is something like this (but would like ...
0
votes
1answer
102 views

Two commands at once in Bash

I want to add a bash command that does the following: Currently, I need to run this: $ pdflatex <filename>.tex | open <filename>.pdf Is there any way to convert that into something like ...