Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to view the content of a file in unix in ftp mode of DOS? [closed]

Tags:

unix

windows

ftp

How can I view the content of a file (on a Unix server) when I log into Unix from the Windows command prompt in FTP mode? I tried vi,cat and ed but none of them works.I can view the files using ls -l, but can't view the content. If there is any special command please let me know.

like image 792
user893096 Avatar asked Aug 13 '11 14:08

user893096


People also ask

How do I FTP in Unix?

If you are using unix or linux operating systems, just simply type the ftp command on the terminal. Once the ftp connects to the remote server name, it will prompt you to enter the user name and password. After successful login, your terminal or prompt changes to “ftp>”.


2 Answers

The GET command will print file contents to the console if you pass '-' as the output filename. E.g. ..

$ ftp some_site.com
...
ftp> get some_file.txt -
remote: some_file.txt
229 Extended Passive Mode Entered (|||36565|)
150 Opening BINARY mode data connection for php_errors.log (438 bytes)
...
... contents of some_file.txt will be printed here
...
226 Transfer complete
438 bytes received in 00:00 (116.51 KiB/s)
ftp>
like image 71
broofa Avatar answered Oct 19 '22 03:10

broofa


You can not run VI and cat over a FTP client. You want to log into the unix box with SSH and then use VI and/or cat.

FTP is for file transfers only.

SSH allows for command line functions. Editing and viewing of files on the server.

like image 3
dhempler Avatar answered Oct 19 '22 04:10

dhempler