Jump to content
reiko

Ajutor comanda "sort"

Recommended Posts

cat fisier | grep "sa^"

daca nu ai linux ... ghinion :))

E gresit..

Uite aici ceva folositor in Linux:

Ai asa:

terasa
casa
ceasca
cafea
suc
masa
rufe
dor
nues
modosa

Si dai asa..

cat a.txt |grep sa$ |sort |uniq

Vei obtine:

casa
masa
modosa
terasa

Ce face? Pei.. grep le selecteaza pe cele cu terminatia sa, sort le sorteaza in ordine alfabetica, iar uniq le sterge pe alea care se repeta.

Bafta

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...