Skip to content

Instantly share code, notes, and snippets.

@diogocapela
Last active October 28, 2017 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogocapela/3f5bab0f6c67362d4a79f0c93fa0e9e0 to your computer and use it in GitHub Desktop.
Save diogocapela/3f5bab0f6c67362d4a79f0c93fa0e9e0 to your computer and use it in GitHub Desktop.

PRCMP Sprint 2

Exercício 1A

cp [ABCDEFGHIJKLMNOPQRSTUVWXYZ]*.jpeg /tmp/jpegues/IMG
cp [[:upper:]]*.jpeg /tmp/jpegues/IMG

Exercício 1B

ls | grep '^conta_' | wc -l
ls | egrep 'conta_*' | wc -l
find -name 'conta_*'

Exercício 1C

sed -n '1p;8p' basedados.txt > 1_8.txt

Exercício 2A

// falta apagar as linhas com maiusculas
cat memes.txt | tr -s " \n" > memes1.txt

// este apaga todas as linhas q tem pelo menos 1 maiuscula
cat memes.txt | tr -s " \n" | grep -Ev '[[:upper:]]' > memes1.txt

Exercício 2B

// apresentar todas as 3as colunas quando separadas com underscore
cat memes.txt | cut -f3 -d "_"

// comando já resolvido (wc -L conta a palavra com maior comprimento)
cat memes.txt | cut -f3 -d "_" | wc -L

Exercício 2C

Exercício 3

find -iname 'fernandopessoa-*prosa.doc'

Exercício 4

find dinheiro -iname '.ptt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment