xrdp в ubuntu с помощью Gnome

Используйтеgrep:

grep -Fwf file1 file2

изman grep:

-F, --fixed-strings
    Interpret PATTERN as a list  of  fixed  strings  (instead  of  regular  expressions),  separated  by
    newlines, any of which is to be matched.

-f FILE, --file=FILE
    Obtain patterns from FILE, one per line.  If this option is used multiple times or is combined  with
    the -e (--regexp) option, search for all patterns given.  The empty file contains zero patterns, and
    therefore matches nothing.

-w, --word-regexp
    Select only those lines containing matches that form whole words.  The test  is  that  the  matching
    substring  must  either  be  at  the  beginning  of  the line, or preceded by a non-word constituent
    character.  Similarly, it must be either  at  the  end  of  the  line  or  followed  by  a  non-word
    constituent character.  Word-constituent characters are letters, digits, and the underscore.

Илиawk:

awk 'NR==FNR{seen[$0]++} ($2 in seen)' file1 file2

В приведенном выше примере сначала мы читаем файл1 и сохраняем весь столбец1 из массива с именем , видимым , затем смотрим в файле2 его второй столбец, и если он соответствует сохраненный столбец1 из файла1 затем переходит к печати всей строки файла2.

У вас также есть команда join, если оба файла отсортированы (, если нет, вы можете передать отсортированный вывод, sorting):

join -1 1 -2 2 file1 file2

изman join

-1 FIELD
      join on this FIELD of file 1

-2 FIELD
      join on this FIELD of file 2

если файлы не отсортированы:

join -1 1 -2 2 <(sort file1) <(sort file2)

0
25.09.2019, 19:42
1 ответ

Ваш вопрос все еще немного неясен для меня, и у меня недостаточно вопросов, чтобы спросить в комментариях о разъяснениях.

Хотя,

gnome-sessionдолжен запустить gnome. Это то, что я использовал в прошлом. Однако это было для Gnome2 дней. С Gnome3 я отказался от корабля после недолгого использования, так что, вероятно, все по-другому.

В качестве альтернативы, если у вас есть только один configure DE, вам может сойти с рукstartx

0
28.01.2020, 03:15

Теги

Похожие вопросы