how to view the content of a file in unix in ftp mode of DOS?
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.
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) `
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/