The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running a queued set of commands? jjinno Shell Programming and Scripting 1 04-25-2008 03:27 AM
Error while running rsh commands !!! csaha Shell Programming and Scripting 3 11-08-2006 01:47 AM
How to disable running commands from vi Umesh_Sharoff Shell Programming and Scripting 1 07-14-2006 12:05 PM
running commands from script owijust Shell Programming and Scripting 2 01-09-2006 06:12 PM
running start up commands skotapal UNIX for Dummies Questions & Answers 3 12-03-2002 07:31 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-30-2007
rdns rdns is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 25
Running two commands in one line

hi!

how do i run 2 command from the same line
e.g: 'which screen' and then ls -la 'which screen'
  #2 (permalink)  
Old 11-30-2007
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,861
Code:
which screen; ls -la `which screen`
  #3 (permalink)  
Old 11-30-2007
rdns rdns is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 25
Quote:
Originally Posted by fpmurphy View Post
Code:
which screen; ls -la `which screen`
thank you. I will remember this the rest of my life
  #4 (permalink)  
Old 04-27-2009
abhilash_menon abhilash_menon is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 5
I would like to know how can I write the output of these 2 commands into a file.I tried like
wc -l outfile2;du -sk outfile2>xyz.txt
Then it is writing only the output of second command to the file.
Without writing to a file, it is giving outputs of both correctly.Any thoughts?

Last edited by abhilash_menon; 04-27-2009 at 10:53 AM.. Reason: Correction
  #5 (permalink)  
Old 04-27-2009
abhilash_menon abhilash_menon is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 5
Thanks.I got the same as
echo `wc -l outfile2; du -sk outfile2` > xyz.txt
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0