Ubuntu

Start works with linux - Ubuntu.

Main documentation: https://help.ubuntu.com/

How to install Ubuntu on VirtualBox

VirtualBox

First steps with terminal

#Shortcut to OPEN terminal
ctrl + alt + t

#Shortcut to CLOSE terminal
ctrl + d

#Kill the terminal proccess
cltr + c

#Auto completion of files names
use TAB while you are typing any name of file

Shortcuts

Basic terminal commands

help

help command will help us how to use a parameters

Used cd --help command

man

  • manual page of commands (like help, but better graphical)

whatis

  • short description of linux commands

history

  • show history of commands used in terminal

  • the whole bash history is in file ~/.bash_history

show list of used commands

pwd

print working directory

Show our current path

cd

change directory

cd commands

echo

  • print a wrote text

gedit

  • graphical text editor

  • create a new file and start to edit

  • edit current file

nano

  • terminal text editor

nano looks like

cat / tac

  • show text in the same window of terminal

cat and tac commands

head / tail

  • head print first lines from the file

  • tail print the last lines from the file

[TIP] to create 30 or more lines of numbers use command:

tail and head commands

wc

  • show line number , word number , byte/character numbers

ls

  • list a directory content

basic ls commands
green - inode number | blue file size in bytes

hidden files always have dot "." before name like .hidden

ln

  • the same inode number

  • the exactly same size of file

3 the same files by Hard Link

(it's the same as shortcut in windows)

  • different inode number

  • smaller file size - only 8 bites

Files commands

touch

  • change timestamp of a file on current date and time

  • create a new file

All hard linked files change timestamp like example/hardlink1/hardlink2
Create a new file

mkdir

  • create an empty directory

rmdir

  • remove an empty directory

rm

  • remove a files and directories with files

cp

  • copy files

mv

  • move files

  • renaming files

file

check properties and file extension

After delete file extension in Ubuntu still possible is correctly opening files

which / type

  • which -> print path to another command like cp / ls ... [display an Executable's location]

  • type -> print path to another command and show is this command is shell builtin

Types of commands: 1. Executable Programs 2. Shell builtins 3. Shell scripts 4. Alias

Filenames with space and special characters

Create file and directory with space or special characters

special characters like: $, >, <, &, ;, |, ', " ...

Spacebar
Special characters

Own commands

multiple commands

  • use more than 1 command in one time

wildcards

'*' and '?'

  • wildcard is a symbol that represents one or more characters

  • symbol '*' represents (matches) ANY characters

  • symbol '?' represents (matches) a SINGLE character

'*' and '?' wildcards in use

'[RANGE]'

aliases

  • help to works faster with use specific own commands

Last updated

Was this helpful?