Terminal

(beginners guide to using the terminal)
Line 25: Line 25:
To list hidden files and directories
To list hidden files and directories
-
~# ls -la
+
~# ls -la [enter]
Show disk usage in megabytes
Show disk usage in megabytes
-
~# du -m
+
~# du -m [enter]
You can do fancy things and link commands together with what is called a pipe this symbol |  
You can do fancy things and link commands together with what is called a pipe this symbol |  
Line 35: Line 35:
So using du with the sort command you can list files and sort in order of megabytes,
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 | 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.
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.
Line 41: Line 41:
To copy files use cp, so  
To copy files use cp, so  
-
~# cp file file2
+
~# cp file file2 [enter]
This would make a copy of file and call it file2
This would make a copy of file and call it file2
-
To change directory us cd, so
+
To change directory use cd, so
-
~# cd MyDocs/
+
~# cd MyDocs/ [enter]
To go back a level on a directory
To go back a level on a directory
-
~# cd ../
+
~# cd ../ [enter]
To create a directory, use mkdir
To create a directory, use mkdir
-
mkdir mydirectory/
+
mkdir mydirectory/ [enter]
-
To move files us mv
+
To move files use mv
-
~# mv file2 mydirectory/file2
+
~# mv file2 mydirectory/file2 [enter]
moving file2 to mydirectory/ directory
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.
+
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!!'''

Revision as of 20:45, 4 December 2009

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 [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 |

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

To change directory use cd, so

~# cd MyDocs/ [enter]

To go back a level on a directory

~# cd ../ [enter]

To create a directory, use mkdir

mkdir mydirectory/ [enter]

To move files use mv

~# mv file2 mydirectory/file2 [enter]

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 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!!