Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

B A SICS A N D

A DVA NCED
LI N UX
CO M M A N D S

Sandeep Kumar Dhanda, Ph.D.


• Operating systems

OUTLINE OF • File handling with the Linux


THE • Basic commands
PRESENTATION • Scripts and a few one liners
• Some demo and hands on session
MOTIVATION MESSAGE
• A software that communicate between user and
hardware
• Linux: Open source, ~2% users
• MacOS: Apple Propriety, 13% users
OPERATING • Windows: Microsoft Propriety, 83% users
SYSTEMS
(OS) • You can have two or more operating systems in one
computer.
• VirtualBox
• Users with Windows 10 or later can install additional
OS from windows store
• It is free
• No extra layer of antivirus protection required
WHY • Supported by a big user community
SHOULD • A huge list of libraries and codes are available in
WE USE open source
LINUX? • Allows multiple users to work on the same
machine/servers
• Extendable to build secure webservers
• MacOS and Linux users
• Find and open Terminal application
• Windows 10 or later users
• https://docs.microsoft.com/en-us/windows/wsl/install-
HOW C AN win10
YOU • Install Ubuntu from the windows Store
PRACTICE • Inside the Ubuntu: find and open terminal
LINUX • Windows OS before Windows 10
COMMANDS?
• Install Virtualbox
• Install Linux inside Virtualbox
• Find and open terminal
Many
• Ubuntu
variants • Red hat
available
• Fedora
LINUX
You can use
the base for
one of them • OSDDlinux
and modify • Biolinux
to have your
own Linux
Function Basic languages support Extended support
Scripting Shell PHP
Text processing Awk Python
Sed Perl
..etc

PROGRAMMING ON LINUX
To write/edit
the text in a file

TEXT EDITORS Its is equivalent


to Notepad.
• Basic editor:Vim
• Advanced: Gedit
Print pwd: print working directory

List ls: list of files

Find find: find out files

Copy cp: copy


FILE NAVIGATING
Move mv: move AND CREATING
COMMANDS
Create mkdir: create a new directory

Remove rm: remove file

Remove rmdir: remove directory

Clear clear: to clear the screen


Man man: manual of the command

Date date: provides the current date and time

Print whoami: print the username

BASIC INFO Display which: display the selected program file


COMMANDS
Top top: sorted information about the process

History history: shows list of commands used

Du du: disk usage


FILE CONTENT COMMANDS

cat cat: concatenate or display the content of a file

Head head: First 10 lines of a file

Tail tail: bottom 10 lines of a file

Echo echo: print


Write >: write output in a file

Append >>: write and append output in a file

Input <: input file


OPERATIONS
COMMANDS
OR ||: One of the two commands

AND &&: Both the commands

Pipe I: output of first command to next


• “How to write this in a script”
SCRIPTS • Execute a program: explain the permissions
Number Permission Type Symbol

PERMISSIONS 0 No Permission ---

1 Execute --x

2 Write -w-
• Ownership: 3 Execute + Write -wx
• User 4 Read r--

• Groups 5 Read + Execute r-x

• Other 6 Read +Write rw-

7 Read + Write rwx


+Execute
grep “-v”, “-i”, “-f”, “-w”

...IMPORTANT sort “-n”, “-t”


ONE LINERS
(COMMANDS)

awk –F “\t” ‘$1>4 {print $2}’


THANK YOU FOR YOUR ATTENTION !!

Happy to take questions now !!

If your questions are not addressed in the presentation..


Feel free to connect me on Networking sites.

You might also like