SlideShare una empresa de Scribd logo
1 de 22
Linux Desktop Usage
Linux Desktop Usage
• Upon boot-up completion of a Linux system, a “login” prompt
will be displayed; username is to be input here and the
password in the “password” prompt.
• Note that no marks at all are written into the prompt line
when typing in the password, that is normal.
• A successful login will result in receiving the shell (Linux
command line interface) prompt; the default shell in many
modern Linux distributions is Bash (Bourne Again Shell) which
is a newer and improved version of ‘sh’.
• There are several other alternatives for Bash
 TCSH
 CSH
 KSH
Logging into Linux
• The login process is the identification and authorization of a
user in the system.
• Multiple users are allows to log into the same system
simultaneously.
• The username and password provided are checked, by
default, against these three files:
 /etc/passwd: this file keeps a listing of all the currently existing users
on the system; users and their properties, such as home-directory
location and default shell can also be edited in this file.
 /etc/shadow: this file encrypts and contains the passwords to all of
the system’s users; it can also be used to manage password properties
such as setting the interval in which the password needs to be
changed, make the password inactive, etc.
 /etc/group: this file lists and manages the groups on the system and
the assignment of users into groups.
Logging into Linux
• Logins to the system can be performed on the local machine
either in Command Line or GUI mode and Remote Terminal
software such as PuTTY
• When a user logs in from a terminal software, whether
remote or local on the machine, a “pseudo-terminal” is
activated and is represented in the system as pts/0, pts/1,
pts/2 and so forth, depending on the amount of sessions
open concurrently.
• The pseudo-terminal is a piece of software that emulates old
keyboard and screen terminals in order to allow full support
on both modern and old systems, such as UNIX.
Running Shell Commands
• Linux(UNIX) is case sensitive. Most command names are
lower case
• Commands starts at the beginning of the line
• Commands and arguments are separated by space(s)
Commands are terminated by <CR> (The value of Enter)
• In most cases, the location of each argument is not relevant
and single character arguments, can be merged
$ ls
$ ls –l -r -t
$ ls -t -r -l
$ ls -ltr
Running Shell Commands
• When a command is running, use the control sequences to
manage it’s runtime
– CTRL-c Terminate the running program
– CTRL-z Suspends the running program
– fg makes suspended program return
– bg makes suspended program return and send output to the back-
ground
– jobs list all currently running jobs on the current terminal
System information
• Several basic commands can provide information about which
system you are connected to, which account you are using
and what is your system type
– uname [option(s)] print system information, such as name, type,
version and hardware architecture
– id [option(s)] print information about the connected user account
– tty print the terminal name for this session
– who print the list of active user sessions
The Shell Prompt
• A standard shell prompt looks like this:
 [user1@CentOS-LAB ~]$
• The first section is the username of the user currently logged
into the shell, in this case it is “user1”.
• “@” separates the username and the hostname of the Linux
machine, in this case the hostname is “CentOS-LAB”.
• “~” report the current working directory
• “$” represents a regular user
“#” is used when you are logged-in as the ‘root’ user
• The prompt can be customized and even colored.
Switching Users
• In order to switch between users in an active system that we
have already logged-in to, we’d use the “su” command, for
example to switch from the user “user1” to the administrative
user “root”, we will run the following command:
 $ su -
Password:
#
• When running “su –” without specifying any other username
to switch to, the command defaults into switching to the user
“root” and prompts for the root password.
• Once the root password has been successfully provided, the
user has been switched to “root” and the user now has all the
administrative privileges of “root”.
Switching Users
• Switching to another regular user is done the same as
switching to root with the addition of the desired username in
the command line:
$su - test
Password:
$
• As the example above shows, the user “user1” has now
switched to “test”, any action performed on the system now
will be logged as user “test” and either allowed or denied,
depending on that user’s permissions and privileges.
Note: While logged-on as “root”, the “su” command can be used
to switch to any regular username in the system and no
password will be asked since “root” is the all-mighty.
Editing Text Files
• Some of the common text editors for Linux are:
 VI
 VIM
 EMACS
 Nano
• VI is the default editor for Linux and UNIX systems
• On newer distributions we are likely to find VIM, which is “Vi
Improved”. Newer and better version of VI including features
like syntax highlighting
Editing Text Files
• For this example, we will edit a file named “testfile” which
resides under the “/tmp” directory; the example will also use
VIM as the text editor of choice.
• First, we run VIM while defining which file we wish to edit; if
the file does not exist in the specified location, VIM will create
a buffer in which all the new text we type is kept until we
actively save the contents into an actual file, however if we
do not save the contents, they will be lost upon quitting VIM.
• Run the following command to enter VIM:
 $ vim /tmp/testfile
VIM Command/Navigation
• VI has three operation modes
– Navigation: In this mode we are able to navigate between words and
lines in our text file; navigation in VIM is performed using the arrow
keys
– Insert: In this mode we can add, remove and edit text
– Command: VI Command Line
When in Navigation mode, use “CTRL” and the right or left arrow
keys to jump whole words right to beginning of the next or
previous word
VIM Command/Navigation
• VIM has many different commands and shortcuts that can be
used while editing to make the process faster and easier for
the user; here’s a short list of basic actions:
 e: jumps to the end of the current word.
 b: jumps to the beginning of the current word.
 0: jumps to the beginning of the current line.
 $: jumps to the end of the current line.
 H/M/L: jumps to the first, middle or last line of the currently viewed
page on screen, respectively.
 :<n> : jumps to line number <n> in the file, for example :10 will jump
to line number 10.
 u: undo the last action.
 CTRL-r: redo the last action.
VIM Insert
• Insert mode: accessing insert mode in VIM can be done in a
few ways:
 Hitting the “Insert” keyboard button.
 Hitting the “i” keyboard button.
• Once in insert mode, the word “– INSERT –” will be written at
the bottom of the screen, this is the marker you are now in
edit mode and can type in any text you wish as plain text.
• Insert mode has another sub-mode which is called “Replace”;
hitting the “Insert” key a second time while in insert mode
will go into “Replace” and “– REPLACE –” will appear in the
bottom of the screen, this mode allows overwriting any text
in the position of the cursor.
VIM Save / Quit
• After the file has been created or edited it needs to be saved;
in order to do that, we first must return to
command/navigation mode by hitting the “ESC” key twice,
the INSERT or REPLACE marker will disappear from the
bottom.
• While in command/navigation mode, hit : and a marker will
appear in the bottom, this initiates and command line mode
VI commands:
 w save changes to file
 q quit VI
 wq
In case you want to do something that VI recommends against, use the
optional ! to force your command
Linux Help & Documentation
• The vast majority of Linux packages/applications arrive with
built-in documentation.
• There are number of ways to view different types of
documentations of an application:
 The info command: displays general information about the
application, for example run: info ls
 The man command: displays the manual and usage document of an
application, this document usually describes what the command does,
breaks down and explains in-depth each of its options, flags and
arguments and in many cases also provides syntax examples to that
command; for example: man ls
 The –help / -H argument: almost every comamnd in Linux has a set of
options / arguments it can receive; one of these options is –help or –H
which will display a summary of all the possible options that command
can take, right in the command line. Try running: ls --help
Linux Help & Documentation
Directories and files under ‘/usr/share/doc/’. Most
application has many optional documentation, examples
and README files under this folder. This can help you find
answers you can not find in ‘man’ or ‘info’
Linux Help & Documentation
• Reading the manual and documentation usually includes
understanding the Syntax declaration of a specific command.
When reading a Syntax declaration, it is highly important to
notice the different signs and characters and understand their
meanings:
mkdir [-pv] [-m mode] directory_name ...
– The first words stands for the commands name.
– ‘[ ]’ - Optional flags/parameters to the command
– param - Mandatory parameters
– … - The last parameter can be repeated multiple times
Linux Help & Documentation
• ‘man’ is of the most power-full assistance a Linux user can
have. It has all of the information needed in order to run the
different commands, all updated to the current version of the
Operating System
• Use ‘man -k {keyword}’ to find all manual pages which
contains ‘keyword’ in their name or description
• When viewing a manual page, the most important thing to
notice is the ‘section’ in which this page is.
Review the first (upmost) line of the manual page to get the
section number and name. e.g.
“PASSWD(1) BSD General Commands Manual PASSWD(1)”
Linux Help & Documentation
• When running ‘man’ use the following syntax to choose a
section: ‘man [section_number] {manual_name}’
• The ‘whatis’ command, can be used to get the starting lead
when trying to figure out what a command does
(in case you know the exact command name)
Linux Help & Documentation
• Aside from the built-in documentation, there is a great deal of
information online on Google, Wikipedia and numerous other
websites, such as:
 www.linux.com
 www.linuxforums.org
 www.linuxquestions.org
 www.unix.com
 www.howtoforge.com
 www.justlinux.com
And many others.
• These websites contain information varying from general
explanations to detailed how-to guides and answers to real
problems other users have experienced and asked about.

Más contenido relacionado

La actualidad más candente

4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
Gautam Raja
 
Basic unixandsas
Basic unixandsasBasic unixandsas
Basic unixandsas
xxx12321
 
Hpux Csa Rafeeq Rehman
Hpux Csa Rafeeq RehmanHpux Csa Rafeeq Rehman
Hpux Csa Rafeeq Rehman
James
 

La actualidad más candente (20)

Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
 
A beginners introduction to unix
A beginners introduction to unixA beginners introduction to unix
A beginners introduction to unix
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating System
 
Operating System
Operating SystemOperating System
Operating System
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic unixandsas
Basic unixandsasBasic unixandsas
Basic unixandsas
 
Basic dos-commands
Basic dos-commandsBasic dos-commands
Basic dos-commands
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Linux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbaiLinux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbai
 
Hpux Csa Rafeeq Rehman
Hpux Csa Rafeeq RehmanHpux Csa Rafeeq Rehman
Hpux Csa Rafeeq Rehman
 
Ms dos
Ms dosMs dos
Ms dos
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 

Destacado

About the authors
About the authorsAbout the authors
About the authors
butest
 
CyberScope - 2015 Market Review
CyberScope - 2015 Market ReviewCyberScope - 2015 Market Review
CyberScope - 2015 Market Review
resultsig
 
Niche Credentials Dec 2015
Niche Credentials Dec 2015Niche Credentials Dec 2015
Niche Credentials Dec 2015
Zoheb Deshmukh
 

Destacado (17)

09 string processing_with_regex copy
09 string processing_with_regex copy09 string processing_with_regex copy
09 string processing_with_regex copy
 
About the authors
About the authorsAbout the authors
About the authors
 
Application Acceleration: Faster Performance for End Users
Application Acceleration: Faster Performance for End Users	Application Acceleration: Faster Performance for End Users
Application Acceleration: Faster Performance for End Users
 
5 Winning Strategies - Social Ecommerce Ebook
5 Winning Strategies - Social Ecommerce Ebook5 Winning Strategies - Social Ecommerce Ebook
5 Winning Strategies - Social Ecommerce Ebook
 
Employee Engagement: Fluffy Nonsense or Mission Critical?
Employee Engagement: Fluffy Nonsense or Mission Critical? Employee Engagement: Fluffy Nonsense or Mission Critical?
Employee Engagement: Fluffy Nonsense or Mission Critical?
 
Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...
Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...
Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...
 
Hoopsfix All Star Classic 2014 Programme
Hoopsfix All Star Classic 2014 ProgrammeHoopsfix All Star Classic 2014 Programme
Hoopsfix All Star Classic 2014 Programme
 
Mabula spa brochure
Mabula spa brochureMabula spa brochure
Mabula spa brochure
 
Who, What, Where and How: Why You Want to Know
 Who, What, Where and How: Why You Want to Know Who, What, Where and How: Why You Want to Know
Who, What, Where and How: Why You Want to Know
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystem
 
CyberScope - 2015 Market Review
CyberScope - 2015 Market ReviewCyberScope - 2015 Market Review
CyberScope - 2015 Market Review
 
AlpineII
AlpineIIAlpineII
AlpineII
 
Infographic: The Accidental DBA
Infographic: The Accidental DBAInfographic: The Accidental DBA
Infographic: The Accidental DBA
 
The Art of Visibility: Enabling Multi-Platform Management
The Art of Visibility: Enabling Multi-Platform ManagementThe Art of Visibility: Enabling Multi-Platform Management
The Art of Visibility: Enabling Multi-Platform Management
 
Dit Was 2008 Sofie Van Hoof
Dit Was 2008   Sofie Van HoofDit Was 2008   Sofie Van Hoof
Dit Was 2008 Sofie Van Hoof
 
Niche Credentials Dec 2015
Niche Credentials Dec 2015Niche Credentials Dec 2015
Niche Credentials Dec 2015
 
Geek Sync I Consolidating Indexes in SQL Server
Geek Sync I Consolidating Indexes in SQL ServerGeek Sync I Consolidating Indexes in SQL Server
Geek Sync I Consolidating Indexes in SQL Server
 

Similar a 02 linux desktop usage

Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
 
LinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuIntervLinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuInterv
AbhishekKumar66407
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
midhunjose4u
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
Chander Pandey
 
LINUX
LINUXLINUX
LINUX
ARJUN
 

Similar a 02 linux desktop usage (20)

Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Nithi
NithiNithi
Nithi
 
LinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuIntervLinuInterviewQALinuInterviewQALinuInterv
LinuInterviewQALinuInterviewQALinuInterv
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
60761 linux
60761 linux60761 linux
60761 linux
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
Linux
LinuxLinux
Linux
 
2023comp90024_linux.pdf
2023comp90024_linux.pdf2023comp90024_linux.pdf
2023comp90024_linux.pdf
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
system management -shell programming by Gaurav raikar
system management -shell programming by Gaurav raikarsystem management -shell programming by Gaurav raikar
system management -shell programming by Gaurav raikar
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
cisco
ciscocisco
cisco
 
LINUX
LINUXLINUX
LINUX
 

Más de Shay Cohen

01 linux history overview
01 linux history overview01 linux history overview
01 linux history overview
Shay Cohen
 

Más de Shay Cohen (17)

Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning Memory
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning Kernel
 
Linux Performance Tunning introduction
Linux Performance Tunning introductionLinux Performance Tunning introduction
Linux Performance Tunning introduction
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinux
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Infra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automationInfra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automation
 
14 network tools
14 network tools14 network tools
14 network tools
 
13 process management
13 process management13 process management
13 process management
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving tools
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
10 finding files
10 finding files10 finding files
10 finding files
 
08 text processing_tools
08 text processing_tools08 text processing_tools
08 text processing_tools
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
05 standard io_and_pipes
05 standard io_and_pipes05 standard io_and_pipes
05 standard io_and_pipes
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bash
 
01 linux history overview
01 linux history overview01 linux history overview
01 linux history overview
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

02 linux desktop usage

  • 2. Linux Desktop Usage • Upon boot-up completion of a Linux system, a “login” prompt will be displayed; username is to be input here and the password in the “password” prompt. • Note that no marks at all are written into the prompt line when typing in the password, that is normal. • A successful login will result in receiving the shell (Linux command line interface) prompt; the default shell in many modern Linux distributions is Bash (Bourne Again Shell) which is a newer and improved version of ‘sh’. • There are several other alternatives for Bash  TCSH  CSH  KSH
  • 3. Logging into Linux • The login process is the identification and authorization of a user in the system. • Multiple users are allows to log into the same system simultaneously. • The username and password provided are checked, by default, against these three files:  /etc/passwd: this file keeps a listing of all the currently existing users on the system; users and their properties, such as home-directory location and default shell can also be edited in this file.  /etc/shadow: this file encrypts and contains the passwords to all of the system’s users; it can also be used to manage password properties such as setting the interval in which the password needs to be changed, make the password inactive, etc.  /etc/group: this file lists and manages the groups on the system and the assignment of users into groups.
  • 4. Logging into Linux • Logins to the system can be performed on the local machine either in Command Line or GUI mode and Remote Terminal software such as PuTTY • When a user logs in from a terminal software, whether remote or local on the machine, a “pseudo-terminal” is activated and is represented in the system as pts/0, pts/1, pts/2 and so forth, depending on the amount of sessions open concurrently. • The pseudo-terminal is a piece of software that emulates old keyboard and screen terminals in order to allow full support on both modern and old systems, such as UNIX.
  • 5. Running Shell Commands • Linux(UNIX) is case sensitive. Most command names are lower case • Commands starts at the beginning of the line • Commands and arguments are separated by space(s) Commands are terminated by <CR> (The value of Enter) • In most cases, the location of each argument is not relevant and single character arguments, can be merged $ ls $ ls –l -r -t $ ls -t -r -l $ ls -ltr
  • 6. Running Shell Commands • When a command is running, use the control sequences to manage it’s runtime – CTRL-c Terminate the running program – CTRL-z Suspends the running program – fg makes suspended program return – bg makes suspended program return and send output to the back- ground – jobs list all currently running jobs on the current terminal
  • 7. System information • Several basic commands can provide information about which system you are connected to, which account you are using and what is your system type – uname [option(s)] print system information, such as name, type, version and hardware architecture – id [option(s)] print information about the connected user account – tty print the terminal name for this session – who print the list of active user sessions
  • 8. The Shell Prompt • A standard shell prompt looks like this:  [user1@CentOS-LAB ~]$ • The first section is the username of the user currently logged into the shell, in this case it is “user1”. • “@” separates the username and the hostname of the Linux machine, in this case the hostname is “CentOS-LAB”. • “~” report the current working directory • “$” represents a regular user “#” is used when you are logged-in as the ‘root’ user • The prompt can be customized and even colored.
  • 9. Switching Users • In order to switch between users in an active system that we have already logged-in to, we’d use the “su” command, for example to switch from the user “user1” to the administrative user “root”, we will run the following command:  $ su - Password: # • When running “su –” without specifying any other username to switch to, the command defaults into switching to the user “root” and prompts for the root password. • Once the root password has been successfully provided, the user has been switched to “root” and the user now has all the administrative privileges of “root”.
  • 10. Switching Users • Switching to another regular user is done the same as switching to root with the addition of the desired username in the command line: $su - test Password: $ • As the example above shows, the user “user1” has now switched to “test”, any action performed on the system now will be logged as user “test” and either allowed or denied, depending on that user’s permissions and privileges. Note: While logged-on as “root”, the “su” command can be used to switch to any regular username in the system and no password will be asked since “root” is the all-mighty.
  • 11. Editing Text Files • Some of the common text editors for Linux are:  VI  VIM  EMACS  Nano • VI is the default editor for Linux and UNIX systems • On newer distributions we are likely to find VIM, which is “Vi Improved”. Newer and better version of VI including features like syntax highlighting
  • 12. Editing Text Files • For this example, we will edit a file named “testfile” which resides under the “/tmp” directory; the example will also use VIM as the text editor of choice. • First, we run VIM while defining which file we wish to edit; if the file does not exist in the specified location, VIM will create a buffer in which all the new text we type is kept until we actively save the contents into an actual file, however if we do not save the contents, they will be lost upon quitting VIM. • Run the following command to enter VIM:  $ vim /tmp/testfile
  • 13. VIM Command/Navigation • VI has three operation modes – Navigation: In this mode we are able to navigate between words and lines in our text file; navigation in VIM is performed using the arrow keys – Insert: In this mode we can add, remove and edit text – Command: VI Command Line When in Navigation mode, use “CTRL” and the right or left arrow keys to jump whole words right to beginning of the next or previous word
  • 14. VIM Command/Navigation • VIM has many different commands and shortcuts that can be used while editing to make the process faster and easier for the user; here’s a short list of basic actions:  e: jumps to the end of the current word.  b: jumps to the beginning of the current word.  0: jumps to the beginning of the current line.  $: jumps to the end of the current line.  H/M/L: jumps to the first, middle or last line of the currently viewed page on screen, respectively.  :<n> : jumps to line number <n> in the file, for example :10 will jump to line number 10.  u: undo the last action.  CTRL-r: redo the last action.
  • 15. VIM Insert • Insert mode: accessing insert mode in VIM can be done in a few ways:  Hitting the “Insert” keyboard button.  Hitting the “i” keyboard button. • Once in insert mode, the word “– INSERT –” will be written at the bottom of the screen, this is the marker you are now in edit mode and can type in any text you wish as plain text. • Insert mode has another sub-mode which is called “Replace”; hitting the “Insert” key a second time while in insert mode will go into “Replace” and “– REPLACE –” will appear in the bottom of the screen, this mode allows overwriting any text in the position of the cursor.
  • 16. VIM Save / Quit • After the file has been created or edited it needs to be saved; in order to do that, we first must return to command/navigation mode by hitting the “ESC” key twice, the INSERT or REPLACE marker will disappear from the bottom. • While in command/navigation mode, hit : and a marker will appear in the bottom, this initiates and command line mode VI commands:  w save changes to file  q quit VI  wq In case you want to do something that VI recommends against, use the optional ! to force your command
  • 17. Linux Help & Documentation • The vast majority of Linux packages/applications arrive with built-in documentation. • There are number of ways to view different types of documentations of an application:  The info command: displays general information about the application, for example run: info ls  The man command: displays the manual and usage document of an application, this document usually describes what the command does, breaks down and explains in-depth each of its options, flags and arguments and in many cases also provides syntax examples to that command; for example: man ls  The –help / -H argument: almost every comamnd in Linux has a set of options / arguments it can receive; one of these options is –help or –H which will display a summary of all the possible options that command can take, right in the command line. Try running: ls --help
  • 18. Linux Help & Documentation Directories and files under ‘/usr/share/doc/’. Most application has many optional documentation, examples and README files under this folder. This can help you find answers you can not find in ‘man’ or ‘info’
  • 19. Linux Help & Documentation • Reading the manual and documentation usually includes understanding the Syntax declaration of a specific command. When reading a Syntax declaration, it is highly important to notice the different signs and characters and understand their meanings: mkdir [-pv] [-m mode] directory_name ... – The first words stands for the commands name. – ‘[ ]’ - Optional flags/parameters to the command – param - Mandatory parameters – … - The last parameter can be repeated multiple times
  • 20. Linux Help & Documentation • ‘man’ is of the most power-full assistance a Linux user can have. It has all of the information needed in order to run the different commands, all updated to the current version of the Operating System • Use ‘man -k {keyword}’ to find all manual pages which contains ‘keyword’ in their name or description • When viewing a manual page, the most important thing to notice is the ‘section’ in which this page is. Review the first (upmost) line of the manual page to get the section number and name. e.g. “PASSWD(1) BSD General Commands Manual PASSWD(1)”
  • 21. Linux Help & Documentation • When running ‘man’ use the following syntax to choose a section: ‘man [section_number] {manual_name}’ • The ‘whatis’ command, can be used to get the starting lead when trying to figure out what a command does (in case you know the exact command name)
  • 22. Linux Help & Documentation • Aside from the built-in documentation, there is a great deal of information online on Google, Wikipedia and numerous other websites, such as:  www.linux.com  www.linuxforums.org  www.linuxquestions.org  www.unix.com  www.howtoforge.com  www.justlinux.com And many others. • These websites contain information varying from general explanations to detailed how-to guides and answers to real problems other users have experienced and asked about.

Notas del editor

  1. Explain the term Terminal and the usages it has today
  2. Explain about ‘ su - ’
  3. Can you do qw instead of wq ?
  4. Exercise: use man pages to find out how to show all system information using ‘ uname ’ use man to understand ‘ ls -ltr ’