Posts

Showing posts with the label Linux

Learning Basic VI commands and shortcuts

 It might useful for Linux beginners. Command Mode  Default mode of vim  Move by character: Arrow Keys, h, j, k, l  Move by word: w, b  Move by sentence: ), (  Move by paragraph: }, {  Jump to line x: xG  Jump to end: G Insert mode  i begins insert mode at the cursor  A append to end of line  I insert at beginning of line  o insert new a line (below)  O insert new line (above Ex Mode o :w writes (saves) the file to disk o :wq writes and quits o :q! quits, even if changes are lost Manipulating Text     change (c)     cut (d)     yank (y)     paste (p) without target     Line in Action     Line as in action     Letter l     Word w     Sentence ahead )     Sentence behind (     Paragraph above {     Paragraph...

How to use IF in bash shell script with example

If condition with sample bash script Now, you can use the if statement to test a condition. If command the general syntax is as follows: if condition then command1 command2 ... commandN fi If given condition is true than the command1, command2..commandN are executed. Otherwise script continues If the condition is true then the following commands get executed. If not the script continues with the next command.  Let’s have a practical example for this. Open a text editor and create the script called check.sh : #!/bin/bash read -p "Enter a password" password if test "$password" == "LinuxAdmin" then echo "Password verified." fi Save and close the file. Give executable permission to check.sh to do so type following command: chmod +x check.sh  ./check.sh Sample Outputs: Enter a password : LinuxAdmin Password verified. Let’s check what if we give wrong password - Run it again: ./check.sh Sample Output: Enter a pas...

Types of Security Attacks on Network

Image
Security attacks break the security barrier of the network and access the network resources . There are two types of security attacks carried on a network. Passive Attack - Defines an attack where an attacker just monitors the network. The attackers aim is not to alter the traffic but to just monitor what information is being transmitted over a network. This compromises the confidentiality of the data being transmitted. At any moment , the attacker can capture the traffic. Types of Security Attacks on Network  Active Attack - Defines an attack in which an attacker causes damage to the data being transmitted over a network. The attacker deletes ,  adds or alters information that is being transmitted over the network. The purpose of security attacks is to violate the protection over the network and to access the network traffic and resources. The other types of attacks that are carried over a network are as follows: Denial of Service (DOS) - Defines the most o...

Directories in LINUX for Beginners

Directory: /bin /bin contains the binaries which are needed to run LINUX. Directory: /boot /boot has all the files required for booting LINUX on system. Directory: /dev /dev has the devices for all the files. Directory: /etc /etc contains the configuration files of the various software. Normally no one touch this directory. - Directory: /home /home is like My Documents in Windows. This contains the username as the sub directory. - Directory: /lib /lib contains the libraries required fo r the system files. - Directory: /lost+found /lost+found contains the files which are damaged or which are not linked to any directory These damages are due to the incorrect shutdown. - Directory: /mnt This is the directory in which we mount the devices and other file systems. - Directory: /opt Here the optional softwares are installed. - Directory: /root The directory for the user root

35 Basic and Important Commands of Linux OS

When we start using Linux at least we should know the below basic commands. 1. ls -l To list  the files as well as directories those are kept in the particular working directory Syntax [root@sonaby]#ls -l 2. ls -la Same use as 'ls -l' but  this command helps to see the hidden files. Syntax  [root@sonaby]#ls -la 3. ls -li Same as 'ls -la' but it will also shows the Inode number of each and every file Syntax  [root@sonaby]#ls -li 4. ls To see only file name. Syntax  [root@sonaby]#ls 5. clear To clear the screen (short cut Ctrl+l) Syntax  [root@sonaby]#clear 6. exit To end a current session Syntax  [root@sonaby]exit 7. touch To create a new empty file Syntax  [root@sonaby]#touch 8. cd To change the working/present directory Syntax  [root@sonaby]#cd /home/test 9. cat To view the contents of a file and it is also used for creating a new file with some contents Syntax  [root@sonaby]#cat <file name> to view file contents 10. mkdir To mak...

10 basic things you should know about Shell

-  The shell is a unique and multi- faceted program.  - The shell is a command interpreter and a programming language in built.  - There are various types of shells. - The commonly used shells are Bourne Shell (sh), C Shell (csh or tcsh) and Korn Shell    (ksh). - The first shell is Bourne Shell (sh). - These shells have their own built in functions which allow for the creation of the shell   scripts.  - Through the shell, user interacts with the kernel. - The prompt for the Bourne shell is $ or # for the root user and the prompt for the C     shell is %. - We can start shell and exit by using the CTRL+D. - All shells use different syntax and provide different services.

Fun with Firefox Browser..!

Image
Here is small trick that you can do with Firefox. It is just for a fun.. :) chrome://browser/content/browser.xul Copy this and paste it in your Firefox address bar and press Enter. Do this as much you want.. Also read : Write one liner Batch Script to Take Your File Backup 7 Types of Dangerous Virus 2 Software to Keep Your Passwords Safe and Secure

Basic Guidance on Swap Space Sizing on Redhat

       Swap space or a swap area is space on the disk drive used as overflow for parts of memory that are not currently being used. This allows the system to make room in main memory fr data currently beginning processed, and provides emergency overflow if the system is at risk of running out of space in main memory. SYSTEM RAM and Recommended Minimum Swap Space Up to 4 GB            : at least 2 GB 4 GB - 16 GB         : at least 4 GB 16 GB –  64 GB    : at least 8 GB 64 GB – 256 GB   :  at least 16 GB Creating and Using an Additional Swap Partition - Create a new partition using fdisk . Additionally, change the partition type to “ 0*82 Linux Swap” before saving changes with fdisk. - mkswap /dev/vdaN  will prepare the partition for use as a swap area. - blkid  /dev/vdan will determine the ...