Escolar Documentos
Profissional Documentos
Cultura Documentos
C:\WINDOWS> netstat -a
Conexões ativas
Proto Endereço local Endereço externo Estado
TCP marte:0 MARTE:0 LISTENING
TCP marte:1027 MARTE:0 LISTENING
TCP marte:1379 MARTE:0 LISTENING
TCP marte:1380 MARTE:0 LISTENING
TCP marte:1056 MARTE:0 LISTENING
TCP marte:1327 MARTE:0 LISTENING
TCP marte:10110 MARTE:0 LISTENING
TCP marte:137 MARTE:0 LISTENING
TCP marte:138 MARTE:0 LISTENING
TCP marte:nbsession MARTE:0 LISTENING
TCP marte:1027 201.7.176.57:80 CLOSE_WAIT
TCP marte:1331 s-weballigator1.terra.com.br:80 ESTABLISHED
TCP marte:1379 mailer.oasis.servecast.com:80 ESTABLISHED
TCP marte:137 MARTE:0 LISTENING
TCP marte:138 MARTE:0 LISTENING
TCP marte:nbsession MARTE:0 LISTENING
UDP marte:1056 *:*
UDP marte:1327 *:*
UDP marte:nbname *:*
UDP marte:nbdatagram *:*
UDP marte:nbname *:*
UDP marte:nbdatagram *:*
Sempre que houver um endereço externo diferente da própria máquina (MARTE)
significa que o computador está conectado a outro computador.
O número que vem após os dois pontos é a porta na qual está acontecendo a
conexão (nos exemplos acima todos os casos estavam conectados a porta 80).
Assim sendo, no exemplo acima, há uma conexão ao IP 201.7.176.57 na porta 80
(porta de servidor web) que está se encerrando (CLOSE_WAIT) e duas conexões,
também para a porta 80 que estão ativas (ESTABLISHED). São elas:
s-weballigator1.terra.com.br e mailer.oasis.servecast.com
4.3- Operações no Linux
Uma tela parecida com a do Prompt do MS-DOS será mostrada. Esta tela pode
ser maximizada, se for conveniente.
4.3.2- Alterando a data e a hora do sistema
Exemplo:
a) ls
01:43:06 /> ls
bin cygdrive cygwin.bat cygwin.ico etc home lib proc tmp usr uva var
01:43:08 />
b) ls –l
01:44:20 /> ls -l
total 8
drwxr-xr-x 2 Luiz all 0 Apr 1 00:49 bin
dr-xr-xr-x 9 0 root 0 Dec 31 1969 cygdrive
-rwxr-xr-x 1 Luiz all 57 Apr 1 00:52 cygwin.bat
-rw-r--r-- 1 Luiz all 7022 Apr 1 00:52 cygwin.ico
drwxr-xr-x 9 Luiz all 0 Apr 1 00:46 etc
drwxr-xr-x 4 Luiz all 0 Apr 1 00:59 home
drwxr-xr-x 5 Luiz all 0 Apr 1 00:49 lib
dr-xr-xr-x 11 Luiz all 0 Apr 3 01:44 proc
drwxr-xr-x 2 Luiz all 0 Apr 1 00:49 tmp
drwxr-xr-x 13 Luiz all 0 Apr 1 00:49 usr
drwxr-xr-x 2 Luiz all 0 Apr 3 01:38 uva
drwxr-xr-x 7 Luiz all 0 Apr 1 00:49 var
01:44:26 />
b.4) A quarta coluna indica que grupo de usuários pode acessar este arquivo
c) Alguns arquivos ficam escondidos (começam por ponto), e só podem ser vistos
através da opção –a. Combinando com a opção anterior temos ls –la
02:15:13 /> ls -la
total 9
drwxr-xr-x 10 Luiz all 0 Apr 1 00:46 .
drwxr-xr-x 10 Luiz all 0 Apr 1 00:46 ..
drwxr-xr-x 2 Luiz all 0 Apr 1 00:49 bin
dr-xr-xr-x 9 0 root 0 Dec 31 1969 cygdrive
-rwxr-xr-x 1 Luiz all 57 Apr 1 00:52 cygwin.bat
-rw-r--r-- 1 Luiz all 7022 Apr 1 00:52 cygwin.ico
drwxr-xr-x 9 Luiz all 0 Apr 1 00:46 etc
drwxr-xr-x 4 Luiz all 0 Apr 1 00:59 home
drwxr-xr-x 5 Luiz all 0 Apr 1 00:49 lib
dr-xr-xr-x 11 Luiz all 0 Apr 3 02:15 proc
-rw-r--r-- 1 Luiz all 0 Apr 3 01:55 teste
lrwxrwxrwx 1 Luiz all 5 Apr 3 01:55 testel -> teste
drwxr-xr-x 2 Luiz all 0 Apr 1 00:49 tmp
drwxr-xr-x 13 Luiz all 0 Apr 1 00:49 usr
drwxr-xr-x 2 Luiz all 0 Apr 3 01:38 uva
drwxr-xr-x 7 Luiz all 0 Apr 1 00:49 var
02:15:16 />
d) Caso a listagem dos arquivos fique muito grande, é possível fazer uma pausa
através do comando less. Para isso, passa-se o resultado do comando ls –la para
o comando less, através de um direcionador chamado "pipe", representado por |
ls –la | less
O comando combinado acima fará com que o resultado de ls –la não seja exibido
diretamente na tela, mas seja passado para o comando less, que exibe arquivos
na tela paginando-os.
ls –la | less
total 17543
drwxr-xr-x 2 Luiz all 0 Apr 1 00:49 .
drwxr-xr-x 10 Luiz all 0 Apr 1 00:46 ..
-rwxr-xr-x 1 Luiz all 29696 Feb 14 11:22 [.exe
-rwxr-xr-x 1 Luiz all 67072 Dec 16 2002 addftinfo.exe
-rwxr-xr-x 1 Luiz all 8544 Dec 16 2002 afmtodit
-rwxr-xr-x 1 Luiz all 1786 May 4 2005 apropos
-rwxr-xr-x 1 Luiz all 7168 Feb 10 04:00 ascii.exe
-rwxr-xr-x 1 Luiz all 74240 Jan 27 2004 ash.exe
lrwxrwxrwx 1 Luiz all 8 Apr 1 00:50 awk.exe -> gawk.exe
-rwxr-xr-x 1 Luiz all 8704 Feb 10 04:00 banner.exe
-rwxr-xr-x 1 Luiz all 18432 Feb 14 11:22 basename.exe
-rwxr-xr-x 1 Luiz all 451072 Dec 26 13:12 bash.exe
-rwxr-xr-x 1 Luiz all 6846 Dec 26 13:12 bashbug
-rwxr-xr-x 1 Luiz all 76800 Jul 9 2005 bunzip2.exe
-rwxr-xr-x 1 Luiz all 76800 Jul 9 2005 bzcat.exe
lrwxrwxrwx 1 Luiz all 6 Apr 1 00:49 bzcmp -> bzdiff
-rwxr-xr-x 1 Luiz all 2147 Jul 9 2005 bzdiff
lrwxrwxrwx 1 Luiz all 6 Apr 1 00:49 bzegrep -> bzgrep
lrwxrwxrwx 1 Luiz all 6 Apr 1 00:49 bzfgrep -> bzgrep
-rwxr-xr-x 1 Luiz all 1582 Jul 9 2005 bzgrep
-rwxr-xr-x 1 Luiz all 76800 Jul 9 2005 bzip2.exe
-rwxr-xr-x 1 Luiz all 7680 Jul 9 2005 bzip2recover.exe
lrwxrwxrwx 1 Luiz all 6 Apr 1 00:49 bzless -> bzmore
:
ls –lR | less