Linux-Ubuntu/C2/Basic-Commands/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of the script: Basic Commands in Linux

Author: EduPyramids Team

Keywords: linux commands, shell, command interpreter, internal commands, external commands , bash, type, path, video tutorial.

Visual Cue Narration
Slide 1

Title Slide

Welcome to the Spoken tutorial on Basic Commands in Linux.
Slide 2

Learning Objectives

In this tutorial, we will learn about:
  • Linux commands and a command interpreter.
  • Identifying internal and external commands in Linux.
Slide 3

System Requirements

To record this tutorial, I am using
  • Ubuntu OS version 24 point zero 4
Slide 4

Pre-requisites

https://EduPyramids.org

To follow this tutorial,
  • Learners should have Ubuntu version 24 point zero 4
  • For the prerequisite Linux tutorials please visit this website.
Slide 5

Code files

The following code file is required to practice this tutorial

1. bc-commands.txt

This file is provided in the Code Files link of this tutorial page

The following code file is required to practice this tutorial.

This file is provided in the Code Files link of this tutorial page.

Slide 6

Linux Commands

Now let us see what Linux commands are?
  • Linux commands are words used to execute tasks.
  • Most commands are short, usually no more than four characters (e.g. ls, who, ps).
  • Commands are written in lowercase and are case-sensitive.
Screencast:

Press Ctrl, Alt and T keys on your keyboard

Let us open the terminal by pressing Ctrl, Alt, and T keys on the keyboard.
Point to the $ prompt on the terminal window. we can see a prompt ($) and a cursor blinking next to it.

This is where we need to type in a command.

Type at the command prompt:

who >> press Enter

Type at the prompt who and press Enter.

We can see the name of the users logged in on the terminal.

Only Narration Do you know which entity converts these commands into actual actions?

This job is done by the Command Interpreter called the shell.

Slide 7

Shell Program

  • A shell is a program that acts as an interface between the user and Linux.
  • It allows us to enter commands for the operating system to execute.
  • Linux supports multiple shells, and users can choose their preferred one.
  • The default shell on most Linux systems, including Ubuntu, is bash.
  • Its executable file is located at / bin/bash.
  • Bash stands for GNU Bourne-Again Shell and it is part of the GNU suite of tools.
Slide 8

Shell Program

  • Bash is the most popular shell, available on almost all Linux systems.
  • Other shells include Bourne shell (sh), C Shell (csh) and Korn shell(ksh)
  • Bash is the most popular shell, available on almost all Linux systems.
  • Other shells include Bourne shell , C Shell and Korn shell.
Type at the command prompt

echo $SHELL

Let us see which shell we are using?

Type echo space dollar SHELL in capitals and press Enter.

Point to /bin/bash The output shows slash bin slash bash( /bin/bash)

The output shows the present shell that is being used.

Type at $: type ps

Highlight the output: ps is /usr/bin/ps

Now type: type space ps and press Enter.

The output is shown as ps is /usr/bin/ps

This shows that ps is a file stored in the usr/bin directory.

Point to the type ps command. When a command is entered, the shell searches listed directories for it. If found, the program runs; otherwise, a “command not found” error appears.
Type echo $PATH To see the lists of the directories stored in the PATH environment variable,

type echo space dollar PATH in capital.

Press Enter.

Based on how commands are executed, Linux commands are classified into two types:

internal commands and external commands.

Slide 9

External Commands

  • External commands are separate executable files located in the system directories.
  • For example slash bin (/bin), slash u s r slash bin (/usr, or slash s bin.
  • When we run a command, the shell searches through the dollar PATH ($PATH) variable to find the file.
  • Then starts a new "child process" to run it.
  • These are independent programs.
  • We can update them or install new ones (like git or python) without changing the shell.
  • They take slightly more time and memory to launch.
Slide 10

Internal Commands

  • Internal commands are part of the shell's source code like bash.
  • When we type an internal command, the shell executes it directly.
  • They are very fast because no new process needs to be started.
  • They often handle shell-specific tasks like changing directories or managing the environment.
Type at the prompt: type echo

Press Enter.

Type at the prompt, type space echo and press Enter.
Point to the output. The output shows echo is a shell builtin.

It means echo command is an internal command.

Point to the output.

Type: type cd

Type, type space cd and press Enter.

The output shows cd is a shell builtin.

So cd is also an internal command.

We will learn more about commands in the upcoming tutorials.
Slide 11

Summary

In this tutorial, we have learnt about:

  • Linux commands and a command interpreter.
  • Identifying internal and external commands in Linux
With this we come to the end of this tutorial.

Let us summarise.

Slide 12

Assignment

As an assignment,

Run the following commands and check the output

  • type exit
  • ls
  • type cp
As an Assignment, please do the following.
Slide 13

Thank you

This Spoken Tutorial is brought to you by EduPyramids educational services private limited SINE IIT Bombay. Thank you.

Contributors and Content Editors

Ketkinaina, Madhurig