Terminal

This page is for beginners to Linux that would like to try the terminal. Below are some basic commands you can use in the terminal app to get you started.

Before you start backup your data. So long as your data is backed up, then you can start to try out the terminal without any fears of losing any data. This page does not cover gaining 'root' on your device so you should come to no harm. If you are gaining root, then it would best to not only have a backup before you start tinkering, but also to familiarise yourself with how to reflash your device in extreme cases where you need to get back to where you started.

Understand what a command does before you type it Fundamentally you should understand what a command does before typing it in and pressing enter. If you have a linux desktop distribution, like Ubuntu, you can normally type the command with the parameter --help to get a list of options, i.e. ls --help, or look up manual pages if installed, with man ls [enter] to find out what the commands are and their options. However you can't do this on the tablets though as the tablets use cut down embedded commands, (BusyBox - I think?), so look at Linux commands or Busybox list of Linux commands and options for each one

Some example commands, all here are non-destructive.

The terminal should open with a

~ #

To exit the terminal at any time type, exit and enter, so

~# exit [enter]

To list files in a directory type ls and hit enter, so

~# ls [enter]

To list files in a directory with permissions, owners, time, the use the long format with ls, which is ls -l enter

~# ls -l [enter]

To list hidden files and directories

~# ls -la [enter]

Show disk usage in megabytes

~# du -m [enter]

You can do fancy things and link commands together with what is called a pipe (this symbol: | ). What the pipe does is that it takes one program's output and gives it to another as input.

So using du with the sort command you can list files and sort in order of megabytes,

~# du -m | sort -r -n | more [enter]

du -m list files in megabytes then pipes it to sort to sort it in order of megabytes, largest first, then the more command shows you one page of the screen at a time, pressing enter to show the next page.

To copy files use cp, so

~# cp file file2 [enter]

This would make a copy of file and call it file2. Note that "file2" can be a whole other path (like /home/user/MyDocs/afolder/file2)

To change directory use cd, so

~# cd MyDocs/ [enter]

To go back a level on a directory

~# cd ../ [enter]

To go back two levels on a directory

~# cd ../../ [enter]

To go back three... I think you get the idea

To find out which directory you are in

~# pwd [enter]

pwd stands for present working directory

To create a directory, use mkdir

mkdir mydirectory/ [enter]

To move files use mv

~# mv file2 mydirectory/file2 [enter]

moving file2 to mydirectory/ directory

You can also use mv to rename a file

~#mv file newname

But what happens if I want to copy stuff into the directory I am already in do I have to type out the whole direcotry tree again. Well you can but it is much simpler to do the following:

~#mv smydirectory/file .

The dot at the end of the command means the current directory.

One thing to note is the directory structure on the N810. When you open the terminal on the N810 you are in the directory /home/user Equivalent to MyDocuments in Windows. The top level directory like C: drive on Windows is a / known as a root directory. Try and stay in the /home/user directory at first, or look at your memory cards which is in the directory /media.


Again to reiterate make sure you backup your data before tinkering and when you want to try a new command, make sure you understand what it does first.

!!Page is still under contruction!!