Ssh cat file output into a file on local computer


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ssh cat file output into a file on local computer
# 1  
Old 05-04-2015
Ssh cat file output into a file on local computer

Hello,

I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer?

I cannot use scp, because it's blocked.

something like:

Code:
ssh root@remote_maschine "cat /file" > /locale_machine/file

Smilie

Last edited by fpmurphy; 05-04-2015 at 09:36 PM..
# 2  
Old 05-04-2015
Looks good - why not just try it? AND - use code tags!
# 3  
Old 05-04-2015
Yes, you're right. Smilie

Haven't noticed a wrong command, so it didn't work. But now...

Thank you anyway. SmilieSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting SSH Output From Remote to Local Session?

Hi everyone, after about 2 days of scratching my head on this one, I'm finally ready to punt this and ask for some actual help. Here's the situation. We have 1 server, that runs multiple VM's. To gain access to those VM's we ssh from host01 to the other vm hosts. For example when we first log... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

2. Shell Programming and Scripting

Using expect to remote SSH and write to a local file

Hi Guys, So what I am trying to do is : Host A should do a SSH to Host B to F. Login to the remote host and gather the output of uptime and write to to a file in HostA. So by the end of the script, HostA should contain a file that contains the uptime output of Host B,C,D,E,F. Right now... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

3. UNIX for Dummies Questions & Answers

Output of ssh command from localhost - direct to local file.

Hi, i'm trying to gather details from remote hosts and want them to be written to my local linux machine from where i'm using SSH. My command looks some thing like this ssh -q remotehost 'bash -s' <command.txt where command.txt is a file in my local machine containing ps -ef |grep httpd |... (1 Reply)
Discussion started by: poga
1 Replies

4. UNIX for Dummies Questions & Answers

Cat Input & Output to a Log file

Team, we use below command to store the contents in a logfile. cat a.txt > a.log a.txt content is 123 345 Is there any options available to store the command used also? for eg a.log may show as cat a.txt 123 345 (5 Replies)
Discussion started by: sid2013
5 Replies

5. Shell Programming and Scripting

Getting output from a file similar to cat output

I have a file # cat /root/llll 11 22 33 44 When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat. cat /root/shell_script.sh #!/bin/bash var=`cat /root/llll` echo $var (2 Replies)
Discussion started by: anil510
2 Replies

6. Shell Programming and Scripting

Cat a file across ssh?

There is a file on a remote host that I want to read across an ssh tunnel. NOT copy... scp won't work here. And this file requires elevated permissions to read. 'ssh -t remotehost sudo cat /path/to/file' will prompt me for my sudo password and read out the file. But I'm coming up blank for a... (4 Replies)
Discussion started by: jnojr
4 Replies

7. Shell Programming and Scripting

Cat writing only one record in the output file

Hi All, I have an input file containing data as below: Input.DAT XXXXXXX|YYYYYYY|ZZZZZZZZZZ|12334446456|B|YY|111111111|111111111|111111111|111111111|15|3|NNNNNN|Y|3|AAA|111111111... (11 Replies)
Discussion started by: sagar.cumar
11 Replies

8. UNIX for Dummies Questions & Answers

Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going?? cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies

9. Shell Programming and Scripting

cat file and parse output

Hello, I'm new to shell scripting and did a search on the forum to what I want to do but couldn't find anything. I have about 9 routers that outputs to 1 syslog file daily named cisco.year.mo.date.log ex: cisco.2009.05.11.log My goal is to make a parsing script that cats today's syslog... (2 Replies)
Discussion started by: jjrambar
2 Replies

10. UNIX for Dummies Questions & Answers

cat, grep and tee to a local file

Hi, This is what I am trying to do. 1) connect to 3 remote servers from my local machine serverA serverB serverC 2) read error file from each server cat /var/lib/mysql/mydb.err 3) grep for lines displaying "yesterday" date grep "`date +%y%m%d' '-d\"1 day ago\"`" 4) Append those lines to a... (7 Replies)
Discussion started by: shantanuo
7 Replies
Login or Register to Ask a Question