About 214,000 results
Open links in new tab
  1. Linux Bash Script, Single Command But Multiple Lines?

    If I have ssh on the first line and commands on the following lines, I think I need a semicolon as well besides backslash. – Timo Commented Nov 22, 2020 at 8:23

  2. bash - Which one is better: using ; or && to execute multiple …

    Aug 20, 2013 · So for dependent commands you should use &&. Wring bash, or commands with independent commands, use ;. So if you want to shutdown computer even the first job failed use ;, but if want on complete success of first job initiate the shutdown use &&.

  3. bash - How do I create a script file for terminal commands ... - Ask …

    Any (and I mean any) file can be executed in Linux provided the first line is a path to the program that should interpret the file. Common examples include /bin/python, /bin/sh, /bin/dash, but even odd ball things work like /bin/mysql; Bash is a full language. It is vastly more complex than cmd.exe in windows.

  4. How can I use a Bash-like shell on Windows? - Super User

    The issue of Linux commands shadowing windows ones is a common cause of hard to debug trouble in solutions like Cygwin/MSYS2/MinGW. Here's an example: I had a .bat file that was using the timeout command.

  5. How to execute several commands after each other with one …

    Then, insert your commands. Then, put a } on a new line and press Enter. Your commands will be executed. Example: { echo list echo of echo commands echo to run at once } which will print (all at once, with no prompt in between): list of commands to run at once As a side note, { .. } is the Bash command grouping syntax.

  6. How can I search the bash history and rerun a command?

    Jul 18, 2009 · There are a whole host of other readline bindable commands that are available to you as well. Take a look at the bash man page. Bash has many facilities to search and access interactive command history. The most basic of which is the history builtin. Typing just: $ history Will print a list of commands along with a numeric index, like:

  7. Creating A Simple Bash Script With Multiple Commands

    gnome-terminal -e "bash -c \"echo foo; echo bar; exec bash\"" or . gnome-terminal -x bash -c "echo foo; echo bar; bash" The exec bash at the end is necessary because bash -c will terminate once the commands are done. exec causes the running process to be replaced by the new process, otherwise you will have two bash processes running.

  8. How do I create a permanent Bash alias? - Ask Ubuntu

    Dec 15, 2010 · With . ~/.bashrc, you source your bash. Executing the file would start a child process, execute the commands in this process, then return. All that is done in the child process has no effect on the parent process (the bash from which you executed). Instead, sourcing (with the dot) acts exactly as if you wrote the content of the file in the ...

  9. How to view command history of another user in Linux?

    I don't believe there is a way to get a unified command history of a user's normal + sudo commands. On RHEL-based operating systems, you would need to check /var/log/secure instead of /var/log/auth.log .

  10. linux - Continuously re-execute a command when it finishes in …

    #!/bin/bash while true; do do_something && wait done This will execute over and over until bash receives a signal to terminate the process. Usually in the form of ctrl+c. You can also use the watch command to run a script repeatedly as well. For instance a simple clock in your bash terminal using watch could look like: $ watch -t -n1 date +%T

Refresh