User Tools

Site Tools


команды_фильтры

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
команды_фильтры [2018/07/12 07:53]
val [Вывод списка ip адресов из файла]
команды_фильтры [2020/10/06 14:41] (current)
val [tr]
Line 7: Line 7:
  
 <​code>​ <​code>​
-$ cut -d: -f1 /etc/passwd 
 $ cut -d: -f1,7 /etc/passwd $ cut -d: -f1,7 /etc/passwd
-$ cut -d: -f1-3 /etc/passwd+
 $ cut -c1-5 /etc/passwd $ cut -c1-5 /etc/passwd
 +
 +$ cat /etc/passwd | rev | cut -c 2- | rev  #remove last character
 </​code>​ </​code>​
  
Line 16: Line 17:
  
   * [[https://​ru.wikipedia.org/​wiki/​Tr|translate или transliterate — Unix-утилита для преобразования символов]]   * [[https://​ru.wikipedia.org/​wiki/​Tr|translate или transliterate — Unix-утилита для преобразования символов]]
 +  * MySQL запросы [[Сервис MySQL#Из командной строки]]
  
 <​code>​ <​code>​
Line 21: Line 23:
  
 $ df -h / | tr -s ' ' $ df -h / | tr -s ' '
 +
 +$ getent group group1 | cut -f4 -d: | tr ","​ "​\n"​
 +
 +$ echo "​{\"​hw_id\":​\"​2\",​\"​hw_name\":​\"​router\"​}"​ | tr -d '​{}\\'​
 </​code>​ </​code>​
  
Line 29: Line 35:
 Ключи -n -r -u -kN Ключи -n -r -u -kN
  
 +<​code>​
 +$ sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 addresses.txt
 +</​code>​
 ===== uniq ===== ===== uniq =====
  
команды_фильтры.1531371217.txt.gz · Last modified: 2018/07/12 07:53 by val