Basic file editing¶
In this tutorial you will learn
- How to edit files with the command line
To begin, make sure you have a
user account at CSC
that is a member of a project which
has access to the Roihu service.
You should also have already
logged in to Roihu with SSH.
In the previous tutorial we downloaded a file called my-first-file.txt,
made a copy of it named YourName-first-file.txt, and now we practice how to edit it!
These exercises are done with the
nano editor, but you can use your favorite editor too.
Here's a nano cheat sheet.
Processing text files¶
-
Open the file with
nano: -
Edit the file. Type something there!
- Exit
nanowith:Ctrl+X, then- type
Yto confirm saving, and finally - press
Enterto accept the filename.
-
Check that the modifications are actually there:
-
Exit the preview with
q.
Create text files¶
-
You can also create files with
nano. Try simply: -
In the text file, write something (e.g. instructions for others on how to replicate your file creation process), then save and close.
- May I interest you in the basic Markdown guide?
- Use
pwdand copy the path of your current working directory -
Copy the text file to your personal computer for example with
scpThe following has to be typed in your personal computer's terminal, not Roihu (make sure you have set up SSH keys and downloaded an SSH certificate):
-
Look for the file on your personal computer and check that the contents match.
More information¶
You can read more about
scp and moving files from
Docs CSC: Copying files using scp.
One way to display
.html files on Roihu is to go through the Allas object storage service.
After configuring Allas, there are a-commands that enable publishing files on the internet.
This is instructed in the
Allas tutorial.