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.
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>”.
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With