19
Getting into Linux Uma rápida introdução ao Ambiente Shell Linux. Rafael Moreno – rafafm@ System z | Mainframe Systems Operations

Getting into Linux - A brief Introduction to the Shell Linux Environment

Embed Size (px)

DESCRIPTION

Pequeno workshop que apresentei no Training Center da IBM Hortolândia durante o curso "Replicadores de Skills - Formação de novos Instrutores."

Citation preview

Page 1: Getting into Linux - A brief Introduction to the Shell Linux Environment

Getting into LinuxUma rápida introdução ao Ambiente Shell Linux.

Rafael Moreno – rafafm@System z | Mainframe Systems Operations

Page 2: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation2

AGENDA

História do Linux

Como surgiu o Linux?

Desenvolvimento

Uso do Linux no cotidiano

Distribuições Linux

Conhecendo o Ambiente

Logando no Sistema

Conhecendo o Shell

Usuário vs. Superusuário

Saindo do Sistema

Page 3: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation3

AGENDA

Comandos Básicos

Listagem e Criação Diretórios

Renomeando Arquivos e Diretórios

Deletando Arquivos e Diretórios

Lendo e editando o conteúdo de arquivos

Permissões de Acesso

Encontrando Ajuda

Seguindo Adiante

Links e Livros recomendados

Certificações Linux

Page 4: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation4

História do Linux

– Como surgiu o Linux?

– Desenvolvimento

– Uso do Linux no cotidiano

– Distribuições Linux

Page 5: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation5

Conhecendo o Ambiente

- Logando no Sistema

- Conhecendo o Shell

- Usuário e Superusuário

- Saindo do Sistema

Page 6: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation6

Comandos Básicos

ls - lista o conteúdo de diretórios

Sintaxe: ls [OPÇÕES] [ARQUIVO]

Exemplo:

$ ls -l texto1.txt-rw-r--r-- 1 rfm rfm 0 Apr 18 12:13 texto1.txt

Opções mais usadas:

ls -l ~> Exibe diretórios no formato de lista longals -a ~> Exibe arquivos ocultosls -R ~> Lista o conteúdo de diretórios e subdiretórios

Page 7: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation7

Comandos Básicos

pwd – Exibe o diretório de trabalho atual

Sintaxe:pwd [OPÇÕES]

Exemplo:

$ pwd/home/rfm

Page 8: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation8

Comandos Básicos

cd – Muda o diretório de trabalho atual

Sintaxe:

cd [DIRETÓRIO]

Exemplo:

$ pwd

/home/rfm

$ cd Docs

$ pwd

/home/rfm/Docs

Page 9: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation9

Comandos Básicos

mkdir – Cria Diretórios

Sintaxe:

mkdir [OPÇÕES] [DIRETÓRIO]

Exemplo:

$ ls

Desktop Docs Downloads qBT_dir texto1.txt

$ mkdir teste

$ ls

Desktop Docs Downloads qBT_dir teste texto1.txt

Page 10: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation10

Comandos Básicos

mv – Move e Renomeia Arquivos e Diretórios

Sintaxe:

mv [OPÇÕES] ORIGEM DESTINO

Exemplo:

$ ls

Desktop Docs Downloads qBT_dir file.txt

$ mv file.txt texto.txt

$ ls

Desktop Docs Downloads qBT_dir texto.txt

Page 11: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation11

Comandos Básicos

rm – Deleta Arquivos e Diretórios

Sintaxe:

rm [OPÇÕES] ARQUIVO

Exemplo:

$ ls

Desktop Docs Downloads qBT_dir texto1.txt

$ rm -f texto1.txt

$ ls

Desktop Docs Downloads qBT_dir

Page 12: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation12

Comandos Básicos

nano – Editor de Texto Simples

Sintaxe:

nano [+LINHA] [OPÇÕES] [ARQUIVO]

Page 13: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation13

Comandos Básicos

cat – Concatenador de Arquivos

Sintaxe:

cat [OPÇÕES] [ARQUIVO]

Exemplo:

$ cat arq1.txt arq2.txt > tudojunto.txt

$ cat tudojunto.txt

Texto de arquivo 1.

Texto de Arquivo 2.

Page 14: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation14

Comandos Básicos

more – Paginador de Texto

Sintaxe:

more [OPÇÕES] [ARQUIVO]

Exemplo:

$ more textolongo.txt

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna (…)

--More-- (45%)

Page 15: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation15

Comandos Básicos

chmod – Altera Permissões de Acesso

Sintaxe:

chmod [OPÇÕES] MODO[,MODO] ARQUIVO

4 – Permissão de Leitura (r)

2 – Permissão de Escrita (w)

1 – Permissão de Execução (x)

Page 16: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation16

Comandos Básicos

man – Exibe páginas de manual

Sintaxe:

man [ OPÇÕES] [COMANDO]

Exemplo:

$ man ls

LS(1) User Commands

NAME

ls - list directory contents

SYNOPSIS (...)

Page 17: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation17

Comandos Básicos

apropos – Pesquisa nas páginas de manual e descrições

Sintaxe:

apropos [OPÇÕES] [TERMO]

Exemplo:

$ apropos calcbc (1) - An arbitrary precision calculator languageipcalc (1) - An IP Netmask/broadcast/etc calculatorsincos (3) - calculate sin and cos simultaneouslystrlen (3) - calculate the length of a stringxcalc (1) - scientific calculator for X(...)

Page 18: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation18

Seguindo Adiante

Links:

Guia FOCA GNU/Linux – http://www.guiafoca.orgIBM DeveloperWorks - http://www.ibm.com/developerworks/linux

Livros:

Linux, Guia Prático – Editora GdH Press

Linux - Fundamentos, Prática e Certificação LPI – Editora Alta Books

Certificações:

Certificação Linux LPIC - https://www.lpi.org/

Certificação Red Hat Linux - http://br.redhat.com/training/certifications

Page 19: Getting into Linux - A brief Introduction to the Shell Linux Environment

© 2011 IBM Corporation19