The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ls -ltr command On Remote server vasuarjula Shell Programming and Scripting 2 06-01-2008 10:55 AM
ls command in Remote Server vasuarjula AIX 0 05-30-2008 10:22 PM
script to send command periodically to remote server sayeo Shell Programming and Scripting 2 03-17-2008 03:42 AM
Transfer file from local unix server to remote server indira HP-UX 2 05-02-2007 06:15 PM
remote server command in a job Jimbo Shell Programming and Scripting 2 01-30-2002 03:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-30-2008
vasuarjula vasuarjula is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 36
ls command in Remote Server

Unix Box: IBM AIX
Shell : K-Shell

When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this.
What is want is get into the remote server and get the count of required files like "ls -ltr *200805 | wc -l". This is working in my machine but not on remote directory. how can i do this. Advance appreciations for the help
  #2 (permalink)  
Old 05-31-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,941
The ls command option in ftp is not the same as ls(1). It supports a very limited set of options. Read the ftp man page for more information.
  #3 (permalink)  
Old 05-31-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,441
Run the command via ssh:

Code:
ssh host "ls -ltr *200805 | wc -l"

  #4 (permalink)  
Old 05-31-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,960
Quote:
Originally Posted by danmero View Post
Run the command via ssh:

Code:
ssh host "ls -ltr *200805 | wc -l"
With OP's case I think its not possible, where access to specified directory is possible only through ftp login.

Had it been ssh login, there shouldn't be any problem at all.
  #5 (permalink)  
Old 06-02-2008
vasuarjula vasuarjula is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 36
"ssh host ls -ltr *200805* | wc -l"

When i type this, it says invalid command.
ssh is not working.
What is this ssh
and what should i put in place of host. (remote machine name or local machine name)
  #6 (permalink)  
Old 06-08-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,441
What about:

Code:
ssh host "ls -ltr *200805* | wc -l"

Secure Shell - Wikipedia, the free encyclopedia

Quote:
Originally Posted by vasuarjula View Post
and what should i put in place of host. (remote machine name or local machine name)
remote host.
  #7 (permalink)  
Old 05-31-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,960
you might have to check mdtm utility in Net::FTP module.

But again, it will not work in ftp service hosted in windows machine
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 07:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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