Institute for Language Sciences Labs

How-tos

Working with Linux

Last updated on 8 July 2025 by Ashly Pieterman

If you have suggestions on how to improve this document, or find mistakes, please send them to ilslabs@nulluu.nl

Introduction

Linux is a common name for a series of operating systems based on Unix. It’s a different operating system than Windows, as it’s much closer tied to the command line interface (for Windows users: remember MS-DOS?). This has its advantages: we can have much more control about what’s going on with hardware; and it so allows for a real-time environment, which is very useful for experiments that measure e.g. reaction times.

In the labs, we use the Ubuntu Mate distribution of Linux (version 20.04). This distribution has a rich graphical interface and quite an active group of users (so if you get stuck, you might well try googling!).

How to login into Linux?

Almost every PC in the lab is a dual-boot PC: it can boot into both Windows and Linux. To use Linux, select that operating system on start-up. You can log on with your Solis-ID and password. If you can’t log on, make sure you have been added to the lab users group. See this page for details.

The terminal

The terminal is one of the programs you’ll use most on Linux. The terminal allows you to perform commands: one-line expressions that can state what action you want to take on a file or folder. This how it looks like! You can access the terminal by pressing Ctrl+alt+T.

Some frequent terms you’re going to encounter are “directory” and “command.”
Let’s start with directories. You can see your username in green and the current directory your in, in blue after “:”. now you just see “~”, this means you’re working in home folder.

Directories are, simply put, your folders. When you open your file manager, you’ll often see main folders like Downloads, Documents, Pictures, Music, and so on on your homepage. These same folders can also be accessed through the terminal using commands. Two basic and important commands are:

  • ls — which lists the contents of the current directory

  • cd — which stands for “change directory” and lets you move between folders

Let’s see them in action!

As you can see, after using the ls command — which lists all folders in your current location. The output matches the folders you see when browsing your home page in the file manager.

Keep in mind that the terminal is case-sensitive — for example, Documents is not the same as documents.Behind the $ we can see our current directory. To open superimportantfile.txt, you can use the cat command is a quick and convenient option.As you can see, the file contained the text “Hello!!” — success! We’ve successfully read a file from a directory. There are many commands available to access, locate, and read files, and it can be overwhelming to remember them all. Fortunately, the internet offers plenty of helpful resources, guides, and shortcuts. Hopefully, this brief introduction has given you a better understanding of how to navigate and read files using the terminal. If you’re interested in learning more, please refer to the link at the bottom of this page.

The following table describes some common commands. Some preliminary stuff:

  • Note that for adding a directory/file to a command, you can use the tab button to auto-complete the path (or showing possible auto-complete options).
  • Reminder: ‘.’ denotes the current directory, and ‘~’ denotes your home directory (see some of the commands below).
  • Unsure about a command? Use whatis or man to find out more about it.
Action Command
Files and directories
show contents of the current directory ls
show detailed contents of current directory ls -al
show contents of directory ls dirname
move or rename file mv oldfilename newfilename
copy file cp filename newfilename
copy file to current directory cp otherdir/filename .
go to directory cd dirname
go to your home directory cd ~
create new directory mkdir dirname
show current directory path pwd
remove file rm filename
remove (empty) directory rmdir dirname
remove complete directory structure rm -rf dirname
See what’s in a text file
show file contents cat filename
show file contents one screen at a time more filename
idem, scrolling back through arrow keys less filename
show the first 10 lines of a file head filename
show the last 10 lines of a file tail filename
Other
change file or directory permissions chmod options filename
show differences between two text files diff filename1 filename2
search for pattern in file grep "pattern" filename
search for pattern in current directory, recursively grep -r "pattern" .
search for files locate "pattern"
basic info for a command whatis command
show man page for a command man command
show commands related to keyword apropos keyword
start a Zep file zep filename

What to do next?

You don’t necessarily have to become a Linux wizard, but of course it won’t hurt. You can follow an online tutorial, read the Wikipedia entries linked to in the introduction, but you’ll learn most from booting into Linux every once in a while and trying to use the command line for tasks you’d normally use a graphical user interface for.