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.

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

Show disk usage in megabytes

~# du -m

You can do fancy things and link commands together with what is called a pipe this symbol |

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

~# du -m | sort -r -n | more

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

This would make a copy of file and call it file2

To change directory us cd, so

~# cd MyDocs/

To go back a level on a directory

~# cd ../

To create a directory, use mkdir

mkdir mydirectory/

To move files us mv

~# mv file2 mydirectory/file2

moving file2 to mydirectory/ 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 reitrate 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.