Tuesday, September 10, 2019

Linux commands for day to day use

copy the text from ssh editor to local 

cntrl+insert for copy
shift +insert for paste

grep commands for daily use

 grep -B 3 -A 2 'Invalid user' /var/log/auth.log
https://www.loggly.com/ultimate-guide/troubleshooting-with-linux-logs/

scp command to transfer files

1. search text in vi editor

  1. Press ESC key.
  2. Type /vivek.
  3. Hit n to search forwards for the next occurrence of word named “vivek”. You can press N to search backwards.

Find Files linux commad


find / -name "*conf" 
find /home/exampleuser/ -name "*conf" 

2. How to unpack (ungzip, unarchive) a tar.gz file

For many systems, REBOL is distributed as a tar gz file. This is a common archive format. Here's how to unpack it...

For tar.gz

To unpack a tar.gz file, you can use the tar command from the shell. Here's an example:
tar -xzf rebol.tar.gz
The result will be a new directory containing the files.
(Also, on many systems, when you download the tar.gz from a web browser, an unpacker will open, and you can just use that.)

For just .gz (.gzip)

In some cases the file is just a gzip format, not tar. Then you can use:
gunzip rebol.gz
In order to execute it, you will need to add execute permissions to the file:
chmod +x rebol


for more refer below videos on detailed commands


Type Casting in C++

static_cast