Linux Quick Start

Download

You can click on the button bellow to download latest version of ubuntu

Download ubuntu iso

Requirements

  • Usb with minimum 4Gb space
  • Minimum 20Gb free space in your hard disk.
  • Ubunti iso file
  • Rufus tool download here

Installation

Make usb bootable using rufus

follow the instructions to make usb bootable.

  1. Insert usb in computer.
  2. Formet the usb.
  3. Open rufus
    • select your usb drive
    • select ubuntu iso file
    • click start
    • you will get some prompts just click ok.

Shrink drive

shrink a drive or partision

  1. Open disk manegement tool.
  2. Shrink a drive or partision.
  3. Make sure you get atleast 20Gb of space after shrinking.

Reboot

Shut down your computer if its on and then follow the steps below

  1. Insert usb.
  2. Boot computer from usb.
  3. Select the install option.
  4. Now do some basic settings till installation type menu.
  5. Click something else.
  6. Configure your partitions.
  7. Click install.
  8. Set username and password
  9. ubuntu installed :-)

System commands

PrismJS is used as the syntax highlighter here. You can build your own version via their website should you need to.

System info

dsplay the OS name , release and version

uname -srv

CPU info

lscpu

System on time

uptime

Clear screen

clear

System to super-user

su -

It might ask you for root password, so enter it and hit enter.

Check free memory

free

Running processes list

ps

list process

top

Kill process

kill

Display date

date

Display calender

cal

Shut down OS

shutdown

File system & navigation

Here is file system of linux and its basic navigation techniques.

File system

Directory Purpose
/ main Directory (base)
/bin Executable files eg. linux cammands cat,man,ls
/boot files to help system boot including kernal.
/dev contain files for different hardware and devices.
/etc contains initialization scripts and system configuration files.
/home contains user directories.
/lib contains library files including driver modules.
/lost+found for lost files.
/media mounting removal medis file system.
/mnt temp directory for mounted file systems.
/opt used for storing application packages.
/proc has info about linux processes.
/root Root users home diresyory.
/sbin Executable files for commands used by root user.
/srv Used for services hosted by system eg. web,ftp,etc.
/temp temporary directory- deleted during boot.
/usr contains sub-directories for program files.
/var contains log files.

Switch to root users home directory

cd /

Switch to users home directory

cd ~

Display current directory path

pwd

Go one directory up

example: if you are in /root/<first folder>/<second folder>/ after this command you will be in /root/<first folder>/

cd ../

List content

it will display all content of the current directory.

ls

Working with files

these commands will help us to create,delete,edit,view& rename files.

Create file

touch <file-name>

you can create more then one file at a time by typing

touch <firsst-file-name> <second-file-name> <third-file-name>

Delete file

rm <file-name>

you can delete more then one file at a time by typing

rm <firsst-file-name> <second-file-name> <third-file-name>

Edit file

nano <file-name>

after this command nono editor will be opened in your terminl and you can write what ever you want.
If you want to go out of nano editor, follow the steps below

  1. press ctrl + x
  2. if you want to save change hit y otherwisw n
  3. if you want to save will with same name hit enter.

View file

cat <file-name>

Rename file

mv <old-file-name> <new-file-name>

Permissions

Here we will see to change permissions of files.

Change permission of a file

chmod 777 <file-name or path>

In aove cammand 777 can be described as

  • first 7 is for permission for owner
  • second 7 is for current group user
  • third 7 is for other users
& 7 here is the type of permissions to give, types of permissions with their numbric value is listed below
  • 0 = no permission
  • 1 = execute
  • 2 = write
  • 3 = write and execute
  • 4 = read
  • 5 = read and execute
  • 6 = read and write
  • 7 = read, write, and execute

Other cammands

Here we will see some more important commands.

cammand Purpose
hostname display system host name
hostname -i display ip address of host
find /path/to/search -name "file or folder name" used to search a file or folder in a specfic location
df -h display a disk space usage
du <path> display all files in a specific directory and their size
du -s <path> display size of specified directory
w display users that are online
apt-cache search display list of all packages
info <command> online information about a command
whatis <command> short description of the command
type <command> show tle location of command file
su - switch to root while in the shell
shutdown shutdowns the system
alias <short-name="<command>"> helps to make a command short
unalias <short name> remove or delete a saved alias
reboot restarts the system
wc <path to file> count the number of character, words and lines in a file