FOC - DO2

 Introduction to Linux

Linux is an operating system and Android is powered by the linux operating system.  

OS is software that manages the communication between the software and its hardware.

To manage files in Linux OS we can use :

  1. Terminal (Command Line Interface - CLI)
  2. File Manager (Graphical User Interface-GUI)

Why do we use a Command-line Interface?

  • Commands offer more options and are flexible.
  • More commands to copy and upload files in GUI but in the case of CLI a single command can do it.
  • CLI load fast and do not consume RAM like GUI.

There are two ways to launch CLI on Ubuntu;

  1. Go to the Das and type terminal
  2. Or Press ctrl+alt+t

 

Once the CLI is launched the picture will be shown:


  1. First Part - user name. Eg: guru
  2. Second part - hostname. Eg:99  (Helps to identify a computer over the network).
  3. Third part - Computer name. Eg: VirtualBox
  4. Fourth part - Simple separator. Eg: " : "
  5. fifth part - Home Directory. Eg: " ~ "
  6. Sixth part - Sign for regular users.  Eg: $

# - sign for root user

 

Present Working Directory

A directory that you are currently browsing.

Command - pwd (print working directory).

 

Changing Directories.

To change the directory use - cd (change directory).


Navigating Home Directory: Command - cd OR cd~


Moving to the root directory: Command - cd /


 Relative and Absolute Paths

Absolute Paths - Full path is pecified to reach the file

Eg: To browse images in the Pictures directory of the home folder, type - cd /home /guru99 /Pictures.

 

Relative Paths - do not specify the complete location within the same directory in the file system.

Eg: To browse downloads directory, type - cd Downloads

 

 Accessing Hardware Information 

Disk space usage : <df -h> OR <lsblk>

Memory : <free -h>  OR  <cat /proc /meminfo>

CPU : <lscpu> OR <cat / proc / cpu>

Peripheral Component Interconnection (PCI) devices: <lscpi>

 

All information about the hardware: <lshw>

 


Comments

Popular posts from this blog

FOC - DO3

FOC - A03

FOC - E01