Uploading text files into ssh account

I am using my instructor's account, connecting with ssh via terminal. I am trying to upload a text file into this account but couldn't find a command for this. I tried to copy the index of file and paste it into a file created by 'nano' command, but i think this causes some problems for my calculations. Any suggestions ?


There are at least two, no -- three options. Four options. Amongst our options...

  1. scp can be used to directly copy files, in the style of the cp command line:

    scp filename yourlogin@server:/target/folder
    
  2. The sftp commands works like ftp: you start it, and then can use the ftp-style commands like put and get to transfer files back and forth. Here is a sample session:

    myname@leukothea:~/tmp4$ sftp myname@leukothea:/tmp
    Connecting to leukothea...
    Changing to: /tmp
    sftp> put log.txt
    Uploading log.txt to /tmp/log.txt
    log.txt      100%   26     0.0KB/s   00:00    
    sftp> ls
    RtmpEZgt4t
    RtmpU3qZ4z                                                            
    log.txt                                                                
    sftp> quit
    
  3. You can use one of the numerous programs for FTP/SFTP, including Nautilus -- just enter sftp://username@server:/path/to/dir to the Location bar. Now you can just drag files to the target directory.

  4. You can use rsync to synchronize whole folders, keeping modification times etc. This is one of the most useful commands.

  5. Five, five, not four. You can use sshfs to mount your ssh-accessible filesystem like a network drive:

    sudo apt-get install sshfs
    mkdir ~/remote
    sshfs user@server:/path/to/dir ~/remote
    

    You now can navigate to the remote folder in your home directory and use whatever local commands or tool to copy the files.