Moving Files To and From Town
You may want to transfer files to and from tilde.town. This page shows some simple examples of how to do this.
In using the examples on this page USERNAME should be replaced with your username (in lower case).
SCP
A simple way to transfer a file or two is the scp command. You
may already have it installed as it usually comes as part of ssh.
E.g. let's say you have a great need of some adjectives on your local computer. You can transfer adjectives.txt by entering this (on your computer, not town):
scp USERNAME@tilde.town:/town/our/data/adjectives.txt .
If you have set up ssh properly this
will copy the file to the directory you ran scp from (. means 'this
directory').
It works just as well the other way around:
scp my_notes.txt USERNAME@tilde.town:/home/USERNAME/
will copy my_notes.txt to your home directory.
scp is convenient to execute but requires you to know the location
on town you want to transfer from or to.
SFTP
SFTP stands for Secure File Transfer Protocol. There is a command
sftp that uses this protocol to give you a command line interface
allowing you to walk directories and discover files both locally and
remotely.
(scp uses the same protocol under the hood.)
Here is an example session doing roughly the same thing as above, but
also showing how you can view a directory. Note that get downloads,
put uploads, and lls and lcd list and change directory locally
(the extra 'l' is for 'local').
(The listing for /town/our has been edited as it's awfully long, the
'...' indicate cuts — those aren't part of sftp's output)
~ $ sftp USERNAME@tilde.town
Connected to tilde.town.
sftp> pwd
pwd
Remote working directory: /home/USERNAME
sftp> cd /town/our
cd /town/our
sftp> ls
ls
!!
,bef
--help
->
...
data
...
yt
zalgo
zine
~
¯\_(ツ)_⁄¯
sftp> cd data
cd data
sftp> get adjectives.txt
get adjectives.txt
Fetching /town/our/data/adjectives.txt to adjectives.txt
adjectives.txt 100% 11KB 17.2KB/s 00:00
sftp> cd
cd
sftp> pwd
pwd
Remote working directory: /home/USERNAME
sftp> lcd Temp
lcd Temp
sftp> lls
lls
index.html my_notes.txt test.sh
sftp>
sftp> put my_notes.txt
put my_notes.txt
Uploading my_notes.txt to /home/USERNAME/my_notes.txt
my_notes.txt 100% 98 0.3KB/s 00:00
sftp> exit
exit
~ $
Local File Manager SFTP
An even more convenient way of managing remote files is to use a local file manager program. Many file managers will connect using SFTP and present the remote filesystem as though it were local.
Dolphin (KDE File Manager)
Click on 'Network' under 'Remote' in the 'Places' pane. In the location bar at the top it says 'Enter server URL (e.g. smb://[ip address])'. In this bar type in 'sftp://USERNAME@tilde.town/home/USERNAME/' and Dolphin will connect using SFTP to tilde.town and show you your home directory.
Midnight Commander
Midnight Commander is a popular TUI dual-pane file manager. In both the 'Left' and 'Right' menus there is an 'SFTP Link' menu item. It prompts you for the machine name, which is a little misleading as you can just put in 'USERNAME@tilde.town:/home/USERNAME' — and you will need at least 'USERNAME@tilde.town'.
rsync
Another tool for transferring files is rsync. For the odd file that you want somewhere else it doesn't offer any advantages over scp, but it really shines at keeping local and remote directories in sync with one another.
The great advantage with rsync is that it only transfers what has changed, even within a file. So for example if you change a few slides into the middle of a multi-megabyte slideshow, it doesn't have to transfer all those multi-meyabytes all over again (as scp would) but just the data in the middle that has changed.
(It does this by invoking rsync at the other end of the connection, and the two rsyncs use a clever algorithm to find what has changed, transfer only what is necessary to get the target matching the source, and stitch the new version together.)
If you like working on your tilde.town page on your tilde.town site on your local computer, and transerring it to town once you're happy with it, rsync might be quite handy for that:
rsync -rv town_html/ USERNAME@tilde.town:/home/USERNAME/public_html
this will copy all files and directories recursively from the local
directory town_html into your public_html directory on town. But
it will only tranfer what has changed.
-r copy recursively (i.e. descend into directories and copy what's there)
-v verbose (i.e. give you feedback on what rsync is doing)
(note that the slash on town_html/ is significant — without it, rsync will copy the town_html directory itself, so you'll wind up with public_html/town_html. This isn't what is wanted in this example!)
last compiled: 2026-04-24 09:03:12.215281