Pessoal cheguei ao resultado que eu esperava. EU estava querendo listar apenas o tipo de arquivos binarios executaveis que estão dentro do diretorio
/bin (ou /usr/bin)
para isso usei o comando
file
e o script do companheiro moreira
./typeSearch
. Eles estão funcionando perfeitamente em completo sincronismo. Veja.
Na minha pasta /bin possui 3056 arquivos.
- Código: Selecionar todos
[[email protected] ~]$ ls /usr/bin |wc -l
3506
Filtrando apenas os executaveis, esse numero reduz e se torna especifico de 2391
- Código: Selecionar todos
[[email protected] ~]$ file /usr/bin/* |grep "LSB executable" |wc -l
2391
Mas nesse caso ele mostra todos os executaveis (que é algo bom por sinal) mas não distingue entre os de 32 e 64 bits.
Para isso eu uso
- Código: Selecionar todos
[[email protected] ~]$ file /usr/bin/* |grep "ELF 64-bit LSB executable" |wc -l
2357
[[email protected] ~]$ file /usr/bin/* |grep "ELF 32-bit LSB executable" |wc -l
34
Portanto 2357+34 = 2391Agora usando o script ./typeSearch eu consigo listar esses arquivos executaveis pelo nome e endereço.
- Código: Selecionar todos
[[email protected] ~]$ ./typeSearch.sh /usr/bin/ "ELF 64-bit LSB executable"
Searching for the word: ELF 64-bit LSB executable
Folder: /usr/bin/
Please Wait...
[b] 2357 files found.[/b]
[[email protected] ~]$
- Código: Selecionar todos
[Spoiler][[email protected] ~]$ ./typeSearch.sh /usr/bin/ "ELF 32-bit LSB executable"
Searching for the word: ELF 32-bit LSB executable
Folder: /usr/bin/
Please Wait...
/usr/bin/manywin32
/usr/bin/glxgears_fbconfig32
/usr/bin/es2gears_x1132
/usr/bin/offset32
/usr/bin/texture_from_pixmap32
/usr/bin/glxswapcontrol32
/usr/bin/glxcontexts32
/usr/bin/glxdemo32
/usr/bin/overlay32
/usr/bin/es2tri32
/usr/bin/png-fix-itxt-32
/usr/bin/osdemo3232
/usr/bin/pngfix-32
/usr/bin/sharedtex32
/usr/bin/osdemo1632
/usr/bin/pngcp-32
/usr/bin/sharedtex_mt32
/usr/bin/glxgears32
/usr/bin/glxpixmap32
/usr/bin/wincopy32
/usr/bin/glxinfo32
/usr/bin/es2_info32
/usr/bin/glxheads32
/usr/bin/glthreads32
/usr/bin/pbinfo32
/usr/bin/glxsnoop32
/usr/bin/xrotfontdemo32
/usr/bin/xfont32
/usr/bin/shape32
/usr/bin/glxpbdemo32
/usr/bin/multictx32
/usr/bin/glxgears_pixmap32
/usr/bin/pbdemo32
/usr/bin/glsync32
[b]34 files found.[/b]
[[email protected] ~]$ [/Spoiler]
- Código: Selecionar todos
[[email protected] ~]$ ./typeSearch.sh /usr/bin/ "LSB executable"
Searching for the word: LSB executable
Folder: /usr/bin/
Please Wait...
[b]2391 files found.[/b]
[[email protected] ~]$
file /usr/bin/* |grep "LSB executable" |wc -l
equivale a eu digitar
./typeSearch.sh /usr/bin/ "LSB executable"
file /usr/bin/* |grep "ELF 64-bit LSB executable" |wc -l
equivale a eu digitar
./typeSearch.sh /usr/bin/ "ELF 64-bit LSB executable"
file /usr/bin/* |grep "ELF 32-bit LSB executable" |wc -l
equivale a eu digitar
./typeSearch.sh /usr/bin/ "ELF 32-bit LSB executable"
só que o typesearch mostra o caminho de todos os executaveis e era iss oque eu queria.
É notavel a exatidão do script pois
- Código: Selecionar todos
[[email protected] ~]$ file /usr/bin/* |grep "LSB executable" |wc -l
2391
[[email protected] ~]$ file /usr/bin/* |grep "ELF 64-bit LSB executable" |wc -l
2357
[[email protected] ~]$ file /usr/bin/* |grep "ELF 32-bit LSB executable" |wc -l
34
[[email protected] ~]$
Aparece a mesma quantidade no typeSearch
- Código: Selecionar todos
[[email protected] ~]$ ./typeSearch.sh /usr/bin/ "LSB executable"
Searching for the word: LSB executable
Folder: /usr/bin/
Please Wait...
2391 files found.
[[email protected] ~]$ ./typeSearch.sh /usr/bin/ "ELF 64-bit LSB executable"
Searching for the word: ELF 64-bit LSB executable
Folder: /usr/bin/
Please Wait...
2357 files found.
[[email protected] ~]$ ./typeSearch.sh /usr/bin/ "ELF 32-bit LSB executable"
Searching for the word: ELF 32-bit LSB executable
Folder: /usr/bin/
Please Wait...
34 files found.
Eu quis com essa mensagem demonstrar que com o typeSearch eu consigo ver todos os executaveis e lista-los e com isso posso estuda-los separadamente prcurando saber a qual pacote cade executavel pertence.