Osy Report
Osy Report
Osy Report
Micro-Project Report
GROUP MEMBERS:
Date:____________________
Seal Of Institute
1.0 Brief Description :
➢ Introduction :
The Linux command line is a text interface to your computer. Often referred to as the shell,
terminal, console, prompt or various other names, it can give the appearance of being complex
and confusing to use. Yet the ability to copy and paste commands from a website, combined
with the power and flexibility the command line offers, means that using it may be essential
when trying to follow instructions online, including many on this very website!
This tutorial will teach you a little of the history of the command line, then walk you through
some practical exercises to become familiar with a few basic commands and concepts. We’ll
assume no prior knowledge, but by the end we hope you’ll feel a bit more comfortable the
next time you’re faced with some instructions that begin “Open a terminal”.
During the formative years of the computer industry, one of the early operating systems was called Unix.
It was designed to run as a multi-user system on mainframe computers, with users connecting to it
remotely via individual terminals. These terminals were pretty basic by modern standards: just a
keyboard and screen, with no power to run programs locally. Instead they would just send keystrokes to
the server and display any data they received on the screen. There was no mouse, no fancy graphics, not
even any choice of colour. Everything was sent as text, and received as text. Obviously, therefore, any
programs that ran on the mainframe had to produce text as an output and accept text as an input.
Compared with graphics, text is very light on resources. Even on machines from the 1970s, running
hundreds of terminals across glacially slow network connections (by today’s standards), users were still
able to interact with programs quickly and efficiently. The commands were also kept very terse to reduce
the number of keystrokes needed, speeding up people’s use of the terminal even more. This speed and
efficiency is one reason why this text interface is still widely used today.
When logged into a Unix mainframe via a terminal users still had to manage the sort of file management
tasks that you might now perform with a mouse and a couple of windows. Whether creating files,
renaming them, putting them into subdirectories or moving them around on disk, users in the 70s could
do everything entirely with a textual interface.
Each of these tasks required its own program or command: one to change directories (cd), another to list
their contents (ls), a third to rename or move files (mv), and so on. In order to coordinate the execution
of each of these programs, the user would connect to one single master program that could then be used
to launch any of the others. By wrapping the user’s commands this “shell” program, as it was known,
could provide common capabilities to any of them, such as the ability to pass data from one command
straight into another, or to use special wildcard characters to work with lots of similarly named files at
once. Users could even write simple code (called “shell scripts”) which could be used to automate long
series of shell commands in order to make complex tasks easier. The original Unix shell program was
just called sh, but it has been extended and superceded over the years, so on a modern Linux system
you’re most likely to be using a shell called bash. Don’t worry too much about which shell you have, all
the content in this tutorial will work on just about all of them.
Linux is a sort-of-descendent of Unix. The core part of Linux is designed to behave similarly to a Unix
system, such that most of the old shells and other text-based programs run on it quite happily. In theory
you could even hook up one of those old 1970s terminals to a modern Linux box, and access the shell
through that. But these days it’s far more common to use a software terminal: that same old Unix-style
text interface, but running in a window alongside your graphical programs.
➢ Opening a Terminal:
On a Ubuntu 18.04 system you can find a launcher for the terminal by clicking on
the Activities item at the top left of the screen, then typing the first few letters of “terminal”,
“command”, “prompt” or “shell”. Yes, the developers have set up the launcher with all the
most common synonyms, so you should have no problems finding it.
Other versions of Linux, or other flavours of Ubuntu, will usually have a terminal launcher
located in the same place as your other application launchers. It might be hidden away in a
submenu or you might have to search for it from within your launcher, but it’s likely to be
there somewhere.
If you can’t find a launcher, or if you just want a faster way to bring up the terminal, most
Linux systems use the same default keyboard shortcut to start it: Ctrl-Alt-T.
However you launch your terminal, you should end up with a rather dull looking window with
an odd bit of text at the top, much like the image below. Depending on your Linux system the
colours may not be the same, and the text will likely say something different, but the general
layout of a window with a large (mostly empty) text area should be similar.
Let’s run our first command. Click the mouse into the window to make sure that’s where your
keystrokes will go, then type the following command, all in lower case, before pressing
the Enter or Return key to run it.
1. pwd Command:
In Ubuntu (and other Unix-like operating systems), the pwd command stands for "print
working directory." It is used to display the full path of the current directory you are working
in. For example, if you are navigating through different directories in the terminal, using pwd
will show you the absolute path of your current location in the filesystem.
When you type a command in the terminal, it appears next to the "prompt," which is the
system's way of signaling it's ready for input. This is often referred to as the "command line."
After you run a command, its output (if any) appears in the terminal, followed by another
prompt, indicating it's ready for the next command. Some commands may output a lot of text,
while others may run silently without any output, which usually means they succeeded
without issues. The prompt simply reappears to show it's ready for more input.
2. cd Command:
The cd command in Ubuntu (and other Unix-like systems) is used to change directories in
the terminal. It allows you to navigate between different folders in the file system.
3. Who am I Command:
The whoami command in Ubuntu (and other Unix-like systems) is used to display the
current logged-in user's username. It helps you identify which user account is currently
active in the terminal session.
Example: $ whoami
Username
➢ Creating folders and files:
In this section we’re going to create some real files to work with. To avoid accidentally
trampling over any of your real files, we’re going to start by creating a new directory, well away
from your home folder, which will serve as a safer environment in which to experiment:
1. mkdir Command:
• To create a directory in Ubuntu (or any Unix-like operating system), you use the
mkdir command, which stands for "make directory."
• Basic usage: mkdir directory_name
This creates a new directory with the specified name in the current location.
• Example: $ mkdir my_folder
This will create a folder named my_folder in the current directory.
2. touch Command:-
• The touch command in Ubuntu (and other Unix-like operating systems) is primarily
used to create empty files. It can also be used to update the timestamp (modification
and access times) of existing files.
• Basic Usage: $ touch filename
• This creates an empty file with the name filename if it doesn’t already exist.
B. Update the Timestamp of an Existing File: If the file already exists, touch will not
modify its contents, but it will update the file's modification and access times to the
current time.
touch existing_file.txt
C. Create Multiple Files at Once: You can create several files in one command:
touch file1.txt file2.txt file3.txt
D. Create Files with Specific Extensions: You can create files with any extension:
touch index.html script.js styles.css
E. Force Creation of Files (including when you don’t have write permissions): If
you don’t have permission to create the file, you can use the -c flag to prevent
touch from creating files if they don’t exist.
touch -c filename
3. nano Command:
• The nano command in Ubuntu (and other Linux systems) opens the Nano text editor,
which is a simple, user-friendly, command-line text editor. It’s widely used for
editing text files directly from the terminal.
• Basic Usage: nano filename
• This opens the file specified by filename in the Nano text editor. If the file does not
exist, Nano will create it.
D. Creating a New File: If the specified file doesn't exist, Nano will create a new
file when you save it:
nano newfile.txt
4. echo Command:
The echo command in Ubuntu (and other Unix-like operating systems) is used to display a
line of text or string to the terminal. It’s commonly used in shell scripts and command-line
operations to output text or variables.
Basic Usage: echo [option] [string]
Example: echo "Hello, World!"
A. Display Text:
echo "This is some text."
B. Print the Value of Variables: You can use echo to display the value of shell
variables.
myvar="Linux"
echo "I am learning $myvar"
B. Concatenate Multiple Files: You can combine the contents of multiple files and
display them sequentially:
cat file1.txt file2.txt
This will print the contents of both file1.txt and file2.txt to the terminal.
6. rmdir Command:
• The rmdir command in Ubuntu (and other Unix-like systems) is used to remove
empty directories. It only works if the directory is completely empty. If the directory
contains any files or subdirectories, you’ll need to use the rm command with the -r
option to remove it recursively.
• Basic Usage: rmdir [directory_name]
1. Copying Files(cp):
• The cp command is used to copy files and directories.
• Basic Syntax: cp [source] [destination]
• Example: cp file1.txt /home/user/Documents/
• This will copy file1.txt to the Documents folder.
B. Copy a Directory:
• Use the -r flag to copy directories recursively.
• cp -r dir1 /home/user/Documents/
2. Moving Files:
• The mv command is used to move or rename files and directories.
• Move a File: mv file1.txt /home/user/Documents/
• This will move file1.txt to the Documents directory.
A. Rename a File:
• mv oldname.txt newname.txt
• This renames oldname.txt to newname.txt
B. Move a Directory:
• mv dir1 /home/user/Documents/
B. Remove a Directory: Use the -r flag to remove a directory and its contents
recursively.
rm -r dir1/
C. Force Remove: The -f flag can be used to forcefully remove a file, bypassing
any prompts.
rm -f file1.txt
6. Listing of Files(ls):
• The ls command in Ubuntu (and other Unix-like operating systems) is used to list the
contents of a directory. It’s one of the most commonly used commands to view files
and directories.
• Basic Usage: ls [options] [directory]
• If no directory is specified, ls lists the contents of the current directory.
A. Basic Listing:
• ls
• This command lists the files and directories in the current directory. It
only shows the names, without any additional details.
A. Basic ps Command:
• ps
• This shows a snapshot of the current processes running in your shell. It
includes four columns: PID (Process ID), TTY (Terminal associated with
the process), TIME (CPU time used by the process), and CMD (command
that started the process).
B. List All Processes (-e or aux):
• To list all running processes on the system, use:
• ps -e or ps aux
• This displays all processes, including those not started from your terminal.
➢ wait Command:
• The wait command in Ubuntu (and other Unix-like operating systems) is used to
pause script execution until specified background processes have completed. It waits
for the termination of the given process (PID) or all child processes if no PID is
specified. The wait command is primarily used in shell scripting to ensure that certain
processes finish before moving forward with the next command.
• Basic Usage: wait [PID]
A. wait [PID]:
• Description: Waits for the specific process with the given PID to
complete.
• Example:
sleep 10 &
PID=$!
wait $PID
echo "Process $PID finished"
B. wait without Arguments:
• Description: Waits for all background processes (child processes) to
complete.
• Example:
sleep 5 &
sleep 3 &
wait
echo "All background jobs finished"
C. wait -n:
• Description: Waits for any one of the background processes to complete
(i.e., the first one to finish).
• Example:
sleep 5 &
sleep 10 &
wait -n
echo "One of the processes has finished"
D. Exit Status:
• Description: The wait command returns the exit status of the waited-for
command.
• 0: If the command finished successfully.
• Non-zero: If the process terminated with an error or a non-zero exit status.
• Example:
sleep 2 &
PID=$!
wait $PID
echo "The exit status of the process is $?"
➢ Kill Command:
• The kill command in Ubuntu and other Unix-like systems is used to send signals to
processes, typically to terminate them. By default, the kill command sends the
SIGTERM signal, which gracefully terminates a process. However, other signals like
SIGKILL can be used to forcefully stop a process.
• Basic Syntax: kill [options] <PID>
A. kill [PID]:
• Description: Sends the default SIGTERM (signal 15) to the process with
the specified PID, allowing it to terminate gracefully.
• Example: kill 1234
B. kill -l:
• Description: Lists all available signals that can be sent using the kill
command.
• Example: kill -l
• This will display a list of signals like SIGHUP, SIGINT, SIGTERM, etc.
➢ Sleep Command:
• The sleep command in Linux and Unix-like systems is used to pause the execution of
a script or command for a specified amount of time. It is commonly used in shell
scripting to introduce delays between commands or to wait for a specific period
before continuing execution.
• Basic Syntax: sleep [NUMBER][SUFFIX]
• NUMBER: Specifies the amount of time to sleep.
• SUFFIX: Optional. Specifies the time unit. If no suffix is provided, the default unit is
seconds.
➢ Exit Command:
• The exit command in Linux and Unix-like systems is used to terminate a shell session
or script. When executed, it can return an exit status to the parent process, indicating
whether the script or command completed successfully or encountered an error.
• Basic Syntax: exit [n]
• n: An optional numeric argument that specifies the exit status. If no argument is
provided, the exit status of the last executed command is used.
a) Increased Efficiency.
b) Enhanced Control and Customization.
c) Empowerment through Automation.
d) Engagement with Open Source.
e) Greater Adaptability.
1) Firstly, a discussion will be held with group members and course coordinator and idea
about the topic will be encouraged.
2) The topic will be divided into several modules. Then each and every module.
3) A thorough research will be on the modules which will include all the key concepts related to each
modules of the microproject.
4) All the information shall be perfectly arranged into the Specified format and all the errors/mistakes
committed will be resolved.
coordinator
1) Action Plan: 1-8 weeks
Name of the
Sr. Details of activity Start date Finish date responsible team
No. member.
1. Discussion of topic
2. Finalization of topic
Jayesh
3. Preparation of Abstract
Harihar
4. Submission of abstract
5. Literature survey
6. Collection of data
7. Collection of data
8. Discussion of content
14. Viva
15. Presentation
2. Internet -
3. Reference Books 2
Output :
The output of learning Ubuntu commands includes enhanced proficiency in command-line interfaces and
scripting, leading to increased productivity through faster task completion and automation of repetitive
processes. It fosters improved troubleshooting abilities, enabling effective problem diagnosis and
proactive system monitoring. This skill set opens up expanded job opportunities in IT and related fields,
making individuals more marketable. Additionally, learning commands encourages community
engagement through participation in open-source projects and provides a deeper understanding of
computing systems. Ultimately, this knowledge boosts confidence and independence in managing
technology, making individuals valuable assets in any professional setting.
• Communication skills
• Leadership
• Risk Management
• Cost control
• Negotiation
• Task Managemet