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.

- 1,034
- 5
- 30
- 58

- 443
- 2
- 5
- 8
-
Perhaps you can use `GET remote_file CON:`? – user786653 Aug 13 '11 at 14:55
4 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>

- 37,461
- 11
- 73
- 73
You can view via this `root@kali:~$ ftp 10.10.101.129
Connected to 10.10.101.129.
...
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> passive
Passive mode on.
ftp> ls
227 Entering Passive Mode (10,10,101,129,89,219).
150 Here comes the directory listing.
-rw-rw-r-- 1 1001 1001 141 Feb 23 2019 note
226 Directory send OK.
ftp> get note - #This displays the content in that file.
remote: note
227 Entering Passive Mode (10,10,101,129,89,219).
150 Opening BINARY mode data connection for note (141 bytes).
Jerry, I finally got a chance to update our internal social media platform (bookface.com).
Can you signup and like my doggo photos?
Thanks
226 Transfer complete.
141 bytes received in 0.00 secs (273.7481 kB/s) `

- 41
- 4
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.

- 1,048,767
- 296
- 4,058
- 3,343

- 238
- 2
- 10
-
cat doesn't seem to work on the server yes. What you can do is use the get command to save the the file, from the server, to your local machine and then read its contents locally via cat – Pablo Mar 20 '22 at 21:46
-
1
I don't think ftp allows for viewing files only file transfers, I think that some applications emulate a "view" of sorts by transfering part of a file using resumes and offsets to "view" the view able portion of a file. Downloading and viewing would be best if your client doesn't support viewing and your server resuming, it will be doing that anyways if it does.
Note: you should be able to enter the command "?" (no quotes) and get a full list of server supported commands. (see: http://www.cs.colostate.edu/helpdocs/ftp.html)
You should use SSH & putty on windows if you want access to a full terminal. http://www.chiark.greenend.org.uk/~sgtatham/putty/

- 320
- 1
- 5