LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2020, 03:42 PM   #1
atharvdesai1996
LQ Newbie
 
Registered: Dec 2019
Posts: 15

Rep: Reputation: Disabled
ls & vs ls


Can someone please explain me the difeerence between "ls" and "ls &" command in context of parent-child processes?
 
Old 05-26-2020, 04:05 PM   #2
Roken
Member
 
Registered: Oct 2011
Location: Warrington, UK
Distribution: Arch local, Debian on VPS, several RPIs.
Posts: 300
Blog Entries: 1

Rep: Reputation: 55
Appending "&" to any bash command will push it to the background, and anything that follows will continue regardless.

Without "&" then the command must finish before anything after it runs.
 
1 members found this post helpful.
Old 05-26-2020, 04:24 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
ls & vs ls

this looks like a homework question...
 
1 members found this post helpful.
Old 05-26-2020, 04:49 PM   #4
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
When would
Code:
 ls &
ever even be used? wouldn't that be kinda counter-productive?

I use the & argument mostly for launching gui apps or servers.
 
2 members found this post helpful.
Old 05-26-2020, 04:56 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by atharvdesai1996 View Post
Can someone please explain me the difeerence between "ls" and "ls &" command in context of parent-child processes?
Both command forms involve parent and child processes. Their states are different for each way the commands get typed.

What's your impression of the differences?
 
Old 05-26-2020, 11:37 PM   #6
Roken
Member
 
Registered: Oct 2011
Location: Warrington, UK
Distribution: Arch local, Debian on VPS, several RPIs.
Posts: 300
Blog Entries: 1

Rep: Reputation: 55
Quote:
Originally Posted by Mill J View Post
When would
Code:
 ls &
ever even be used? wouldn't that be kinda counter-productive?

That was my thought, too. Can't think of any time you would use it.
 
Old 05-26-2020, 11:41 PM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Question

Quote:
Originally Posted by Roken View Post
That was my thought, too. Can't think of any time you would use it.
You would use it for searching 3x-men movies, and parents behind your back/
 
Old 05-26-2020, 11:43 PM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
@OP check out this link: https://www.tecmint.com/chaining-ope...ical-examples/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
Japanese canna won't work : Warning: かな漢字変&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
*%!# *$&%^! Arwtiz @*%&%) !&*#& fonts!!!! KungFuHamster Linux - General 3 11-19-2004 11:16 AM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration