The Linux Terminal

How to start with Linux

The Linux Terminal, not so scary at all.

Terminal

The Linux terminal is your best tool in every Linux distribution, you can easily do many many things with only your terminal window:

– Start any application installed, for GUI app, you need your X server of course.
– Update your system
– Upgrade your system
– Install any package you like
– Remote connect to other desktops or servers
Scripting 
– Programming
– Text editing
– There are even text based web browser available (Lynx)
– Hardware management
– Etc

Personally I use Bash (Bourne Again Shell) as my shell when working in a terminal, but there are other shells as well:

Zsh (Z shell)
Sh (the bourne shell)
Ksh (korn shell)

Main differences between shells are syntax, scripting types, command piping, different theming etc.

What is a shell

A Linux shell is a computer program that can be used by users to interact with the computer with commands instead of a “click here and click there approach”. You can always use your shell, desktop environment or not.

When you login to a Linux server, you use the shell in the console. When you login to your desktop environment, you use your shell in a terminal application (mine is called Terminator).

Some very basic commands you will use when starting with Linux:

# lists all files in your current directory
$ ls
# change your working directory e.g. cd $HOME
$ cd
# prints the current working directory
$ pwd
# copies a file to another file, use cp -r to copy directories recursively
$ cp
# moves a file or directory
$ mv
# removes a file, use rm -rf to remove everything given as parameter, potentially dangrous :p
$ rm
# removes an empty directory, for full use rm -r
$ rmdir
# creates a directory
$ mkdir
# concatinates a file, use to dump the contents of a file on your screen
$ cat
# greps patterns in strings, lines ,files etc, can be used with cat, e.g. cat users.txt | grep -i marc, -i = ignore case
$ grep
# shows by default the first 10 lines of a file
$ head
# shows by default the last 10 lines of a file
$ tail
# prints only selected parts of a line or strings, e.g. cut -d ” ” -f2 fulle_names.txt, will show only the second field after the first space in the file
$ cut
# touches a file, meaning; creates a new file or “touches” an existing file, which updates the access time of a file
$ touch
# find files on your system e.g. find apple-tree.txt, specify a different directory to search elsewhere, by default find searches the current directory
$ find
# identifies a file, meaning, what type of file, executable, text file, directory etc
$ file
# changes the owder of a file, use -R for directories recursively
$ chown
# changes the modes of the file or directories, read, write, executable
$ chmod
# execute any command as the root user, potentially dangerous
$ sudo
# good guess, it adds a user to the system, you need to give extra parameters
$ useradd
# both are text editors, I never used nano before, only vi or vim. vim = vi improved
$ vi or nano

I would say, do not be afraid of the Terminal and/or Shell, they are your tools when working in Linux. Tools are handy and help you get your work done.

Video which demonstrates the power of the Terminal & Shell

I can not show you all the linux commands and what you can do with the Linux terminal and shell.

This video will show you more in depth of what you actually can do, Linux can be a very powerfull tool. This guy makes some nice videos, just watch a few of them.