Monday, November 21, 2016

group uninstall of packages - centos



So you know how to install a group of packages
 yum groupinstall "X Window System"

To uninstall the same, use :
 yum groupremove "X Window System"


Thursday, November 10, 2016

duplicate lines in a file - command line


Lets say you have a file with some duplicate lines.
How do you figure out them using Linux command line utilities?


 For example, file contents as this:
~$ cat test.txt
line 1
line 2
line 3
line 4
line 5
line 5
line 6
line 7


Now use the command to get the count of duplicate lines.
so, "line 5" is repeated twice.

~$ sort test.txt  | uniq -c
      1 line 1
      1 line 2
      1 line 3
      1 line 4
      2 line 5
      1 line 6
      1 line 7

To get that specific line alone use -cd
~$ sort test.txt  | uniq -cd
      2 line 5

Tuesday, November 8, 2016

markdown editor - with preview


There may be many markdown editors available.

but atom from github seems to be the winner :)

first open the file using File-> open.

then, go to packages -> markdown preview -> toggle preview.

Awesome..isn't it?

Monday, November 7, 2016

tldr - simplified man pages

man pages for linux commands are quite lengthy in nature.
They try to cover all aspects of a command.

How about a some simple examples for a linux command.

Welcome to tldr - simplified man page for linux command

Install as below:

sudo yum install npm
npm install -g tldr
tldr --update

Usage is like:

# tldr ls

  ls

  List directory contents.

  - List files one per line:
    ls -1

  - List all files, including hidden files:
    ls -a

  - Long format list (permissions, ownership, size and modification date) of all files:
    ls -la

  - Long format list with size displayed using human readable units (KB, MB, GB):
    ls -lh

  - Long format list sorted by size (descending):
    ls -lS

  - Long format list of all files, sorted by modification date (oldest first):
    ls -ltr