Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Server Daily
IT Management Daily
Subscribe News
Subscribe PR
Subscribe Security

internet.com
Internet News
Small Business

Advertise
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

An Easy Step-by-Step to Installing and Running Roundcube Webmail on Ubuntu/Linux

Tech Comics: "Groundhog Day"

Want a Job? Learn Linux

PC-BSD 9 review – to FreeBSD what Ubuntu is to Debian

Time to dispel open source myths, says Liam Maxwell

SECURITY: Nmap Inside and Out

Eight features Windows 8 'borrowed' from Linux

Malware devs embrace open-source

A tale of two distros: Ubuntu and Linux Mint

Raspberry Pi benchmarked against Beagleboard, low price is long term



Applications Management Engineer Sr (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
:Chaining Linux Commands Together
Chaining Linux Commands Together
Feb 3, 2009, 01 :32 UTC (0 Talkback[s]) (8445 reads)

[ Thanks to Brandon for this link. ]

"What if you wanted to run a command and when it finished, run another? Linux provides three ways to do this with a slightly different end result. The semicolon (;), ampersand (&) and the verticle pipe (|) all help the user "chain" commands together.

"[user@localhost ~]$ apt-get update ; apt-get upgrade

"In this example we are using the semicolon (;) to separate these two commands. Using a semicolon tells the shell, "once the first command finishes, run the second one". Once apt-get update finishes, the system will then run it again using the upgrade option.

"[user@localhost ~/project1]$ ./configure && make && make install

"This command is mainly used by developers, software package maintainers and Linux power users. This chain of commands compiles a program and installs it. What the double-ampersands are telling the system is "wait for the first command to successfully complete. If it does complete successfully, run the next command".

Complete Story

Related Stories:
10 Mistakes New Linux Administrators Make(Dec 01, 2008)
Tip: Using find Command in Linux(Nov 19, 2008)
Tips and Tricks for Working on the Command Line(Nov 12, 2008)
NetCat Tutorial for Linux & Windows(Sep 22, 2008)
Bash Shell: Take Control of PS1, PS2, PS3, PS4 and PROMPT_COMMAND(Sep 12, 2008)
The Joys of xargs(Aug 29, 2008)
Review: Bash Cookbook(Aug 13, 2008)
15 Examples To Master Linux Command Line History(Aug 12, 2008)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!

..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP