Editing Terminal
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 16: | Line 16: | ||
# Select ‘Utilities’ | # Select ‘Utilities’ | ||
# Select ‘X Terminal’ | # Select ‘X Terminal’ | ||
- | |||
- | |||
- | |||
== Using the terminal == | == Using the terminal == | ||
'''Before you start, backup your data''' | '''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 ' | + | 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''' | '''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 | + | 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 <code>--help</code> to get a list of options, i.e. <code>ls --help</code>, or look up manual pages if installed, with: |
man ls [enter] | 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 [http://ss64.com/bash Linux commands] or [http://www.busybox.net/downloads/BusyBox.html Busybox list of Linux commands and options for each one] | |
- | + | ||
- | + | ||
- | + | ||
- | to find out what | + | |
- | + | ||
- | However | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
=== Basics === | === Basics === | ||
- | |||
- | |||
- | |||
- | |||
==== Basic commands ==== | ==== Basic commands ==== | ||
Line 167: | Line 141: | ||
The dot at the end of the command means the current directory. | The dot at the end of the command means the current directory. | ||
- | |||
- | |||
- | |||
- | |||
==== Removing files ==== | ==== Removing files ==== | ||
Line 181: | Line 151: | ||
~ $ rm -r directory | ~ $ rm -r directory | ||
- | |||
- | |||
==== Directories ==== | ==== Directories ==== | ||
Line 209: | Line 177: | ||
mkdir mydirectory | mkdir mydirectory | ||
- | |||
- | |||
- | |||
- | |||
=== Directory structure === | === Directory structure === | ||
Line 265: | Line 229: | ||
~ $ du -m | ~ $ du -m | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
=== Show a list of installed packages === | === Show a list of installed packages === | ||
Line 288: | Line 245: | ||
<code>du -m</code> lists 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 more pages. | <code>du -m</code> lists 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 more pages. | ||
+ | |||
+ | To show disk (memory cards, etc.) partitions and their space | ||
+ | |||
+ | ~ $ df -h | ||
Show Linux Kernel messages: | Show Linux Kernel messages: | ||
Line 305: | Line 266: | ||
=== Networking === | === Networking === | ||
- | The user PATH does not include /sbin for some reason by default on NITs, which is annoying as | + | The user PATH does not include /sbin for some reason by default on NITs, which is annoying as yoou need to type in <code>/sbin/ifconfig</code> when normally just <code>ifconfig</code> would be sufficient. You can create a symlink to <code>/usr/bin</code> to make things easier: |
- | ~ $ ln -s /sbin/ | + | ~ $ ln -s /sbin/ifcongig /usr/bin/ifconfig |
Example use of <code>grep</code>, which outputs the entire line matching the pattern, in this case "inet addr" which is piped into it from the output of <code>ifconfig</code>: | Example use of <code>grep</code>, which outputs the entire line matching the pattern, in this case "inet addr" which is piped into it from the output of <code>ifconfig</code>: | ||
Line 338: | Line 299: | ||
apt-get update | apt-get update | ||
- | + | Upgrade any installed apps with newer versions (the <code>-y</code> is optional and just avoids it prompting you as to whether or not to proceed): | |
- | apt-get upgrade -y | + | apt-get upgrade -y |
Remove any downloaded package archives. Once the package is installed the downloaded file is no longer needed. The Application Manager does this automatically but if you are using "apt-get" you'll have to do it manually: | Remove any downloaded package archives. Once the package is installed the downloaded file is no longer needed. The Application Manager does this automatically but if you are using "apt-get" you'll have to do it manually: | ||
Line 347: | Line 308: | ||
apt-get autoclean | apt-get autoclean | ||
- | + | Remove any packages which are no longer needed. These are applications/libraries which were automatically installed because of dependencies but are no longer required: | |
apt-get autoremove | apt-get autoremove | ||
- | |||
Install any missing dependencies (which should fix the broken packages issue I had): | Install any missing dependencies (which should fix the broken packages issue I had): | ||
Line 373: | Line 333: | ||
~ $ dpkg -i nano_2.0.6_armel.deb | ~ $ dpkg -i nano_2.0.6_armel.deb | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
== Further reading == | == Further reading == |
Learn more about Contributing to the wiki.