-
Couldn't load subscription status.
- Fork 3
Tutorial: Linux Terminal
With Linux terminal, you can run commands to accomplish some tasks. The terminal can be used to execute scripts, install software packages or handle basic tasks like moving, copying and removing files. This tutorial will show you some basic usage of the terminal.
ctrl + alt + t: open terminal
ctrl + shilf + c: copy text
ctrl + shilf + v: paste text
ctrl + shilf + t: open a new tab
ctrl + c: terminate an execution/a process/a running script
ctrl + z: shunt an execution into the background, suspendedFirst, to open a terminal in Ubuntu, you can either search for Terminal or press ctrl + alt + T. You can open multiple terminal instances at once.
In the terminal, type pwd to see the path of your directory.
$ pwd
/home/usernameNext, type ls to see all files and folders within your directory
$ ls
Downloads Pictures Templates Videos
Desktop examples.desktop Public
Documents Music shared-drives Let's create a folder by using the mkdir <folder_name> command. You can name it anything you want, but in this tutorial we will use tutorial
$ mkdir tutorialTo open the folder you created, type cd <folder_name>
$ cd tutorialTo go back to the previous folder, type cd ... Please make sure you go back to the tutorial folder before continuing the tutorial, i.e. cd tutorial.
In the tutorial folder, type touch <file_name> to create a file. Here, we'll name it text-file. Type ls to check if the file was created.
$ touch text-file
$ ls
text-fileTo print out the content of the file, we use cat
$ cat text-fileTo open the file, we have some options:
- Open using a default text editor.
$ gedit text-file- Open using nano. (recommended)
$ nano text-file- If you already installed Atom. (recommended)
$ atom text-file- Open using
vim(for advanced users only). To exit, pressEscand type:q!to quit without saving.
$ vi text-fileTo open the current directory in File Browser, we can use nautilus. Note that the period . tells it to open the current directory (same when you do atom . or pycharm . in future tutorials):
$ nautilus .Sometimes, you need admin (root, superuser) permission to execute a command. To do so, add sudo in front. For example, to install the git package, you need sudo:
$ sudo apt install git$ pwd
$ ls
$ mkdir <folder_name>
$ cd <folder_name>
$ cd ..
$ touch <file_name>
$ cat <file_name>
$ gedit/nano/atom/vi <file_name>
$ nautilus .
$ sudo <command>Terminator allows you to open multiple views in one tab, which helps a lot when you need to run many scripts in the background.
Press ctrl + alt + t to open a normal terminal, and run the commands below:
$ sudo apt-get update
$ sudo apt-get install terminatorThen close the terminal and search for Terminator.
The top 4 hotkeys below would be the most useful
ctrl + shift + e: Split screen Vertically.
ctrl + shift + o: Split screen horizontally.
ctrl - shift + w: Close the view where the focus is on.
ctrl + tab: Switch between views in one tab.
ctrl + shift + n: Focus on the next view.
ctrl + shift + t: Open a new tab.
ctrl + shift + q: Exit terminator.If you want to use some useful plugins for terminals (git, new themes, etc), you can install ZSH:
https://github.com/robbyrussell/oh-my-zsh

If you need help, come find Merwan Yeditha [email protected] or Audrey Lee [email protected]!