Basic commands¶
In this tutorial you will learn
- How to use basic Linux commands
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
or via the Roihu web interface (and opened a login node shell).
Navigating folders¶
-
Now that you have logged in to Roihu, check which folder you are in by typing
pwdand hittingEnter: -
Check if there are any files:
-
Make a directory and see if it appears:
-
Go to that folder.
If you just type
cd and the first letter of the folder name, then hit tab key,
the terminal completes the name. Handy!
Exploring files¶
-
Download a file into this new folder. Use the command
wgetfor downloading from a URL: -
Check what kind of file you got and what size it is using the
lscommand with some extra options: -
Use the
lesscommand to check out what the file looks like: -
To exit the
lesspreview of the file, hitq.Instead of
lessyou can usecatwhich prints the content of the file(s) straight into the command line. For long textslessis recommended. -
Make a copy of this file:
-
Remove the file we originally downloaded (leave your own copy).
If you don't want to have duplicate files you can use
mv to 'move/rename' the file.
Syntax is the same: mv /path/to/source/oldname /path/to/destination/newname.
More information¶
- Learn how to edit that file in the next tutorial!
For more information about a given
command, type man command or command --help
where command is replaced with the one that you need help with.
If you remember a part of a command that you have used recently you can search for it with the
command
history | grep string. This will show all your used commands that have included the
string string (replace this with the pattern you are searching for).