Posts

All about SED

 Best videos of sed on youtube: playlist here Pattern space and Hold space:  Pattern space and hold space, first read throery  here ,(don't doe exercises there, they are confusing) what does H,h,G,g and x mean and recall above 4 terms 10 times and read the below explanation: When sed reads a file line by line, the line that has been currently read is inserted into the   pattern   buffer (pattern space). Pattern buffer is like the temporary buffer, the scratchpad where the current information is stored. When you tell sed to print, it prints the pattern buffer. Hold buffer / hold space is like a long-term storage, such that you can catch something, store it and reuse it later when sed is processing another line. You do not directly process the hold space, instead, you need to copy it or append to the pattern space if you want to do something with it. For example, the print command  p  prints the pattern space only. Likewise,  s  operates on the...

Scripting Imp rules

Image
1. Command Substitution: old style: `command` new style: $(command) -> Recommanded Eg: echo "Todays date is: `date +%D`"        echo "Todays date is:$(date +%D)" 2. variable substitution $variable name ${variablename} -> Recommanded Never use single quoates for variable substitution Eg: echo '$NAME' ouput: $NAME 3.Arihmetic operations: We can perform arthemetic operations using 4 ways: 2 nd method is not used mostly Example: Note(VVIMP) : Except assignment operator, for all operators we should provide space before and after operator Eg: If we provide space after assignment operator, it would result in error add_result = `expr $a + $b` (Invalid) add_result=`expr $a + $b` (valid, Since no spave before and after = operator) 4.Assignment and comparison: x=10 -> Assignment(No space) x = 10 -> comparison(space) Eg: There is space before and after =, so it is comparison #!/bin/bash read -p "Enter you name:" name if [ $name = "bhuvan"...

Shell scripingby harsha

Image
 Important points only: Variables in shell can be accessed by below 3 ways: echo $A echo ${A} echo "${A}" If you want variable subsitution in string use double quotes, single quotes will not substiute value it will print symbol itself ❯ echo "Value of a is ${A}" Value of a is 100 ❯ echo 'Value of a is ${A}' Value of a is ${A} The ‘ -e ‘ option in Linux acts as an interpretation of escaped characters that are backslashed. Using option ‘\b‘ – backspace with backslash interpretor ‘-e‘ which removes all the spaces in between. $ echo -e "Tecmint \bis \ba \bcommunity \bof \bLinux \bNerds" TecmintisacommunityofLinuxNerds Using option ‘ \n ‘ – New line with backspace interpretor ‘ -e ‘ treats new line from where it is used. $ echo -e "Tecmint \nis \na \ncommunity \nof \nLinux \nNerds" Tecmint is a community of Linux Nerds

Linux notes

 Linux Notes: ## Basics ## 1. Introduction to Linux -- http://bit.ly/Introcudtion_to_Linux 2. Linux Architecture -- http://bit.ly/Linux_Architecture 3. Windows Vs Linux Comparision -- http://bit.ly/Windows_Vs_Linux 4. Bash Shell features -- http://bit.ly/bash_shell 5. Linux Directory Structure -- http://bit.ly/Linux_Directory_structure 6. Linux Boot Process Detailed explanation - http://bit.ly/LinuXboot_process 7. Basic and Common Commands - http://bit.ly/Basicommands 8. All Linux Commands with there description - http://bit.ly/Linux_commands 25 Linux commands - http://bit.ly/29ZhNDn #### System Administration Topics ## 9. Linux Text Editors - http://bit.ly/Text_Editors 10. Linux Operating System Installation - http://bit.ly/Linux_OS_Installation 11. User Profile Management - http://bit.ly/User_Profile_management 12. User Administration (User Creation, Modification and deletion) - http://bit.ly/User_Administration 13. Access Control List - http://bit.ly/29Md71v 14. Head, Sort, Tail...

Linux Administration by adam

 Linux administration playlist: here Different ways of sshing into server: ssh username@ip_of_remote ssh ip_of_remote -l username ssh ip_of_remote -l username -p port ssh -i <key.pem> username@ip_of_remote To know ip address of the machie: ip a ->It will give ip address of all network interfaces hostnamme -i ->It will give ip address of he machine uname -a       It will give information about type of os(Linux), architecture,date time etc

Linux concepts by durga soft

Image
1.Create 10 directories and 5 files in each directory A. mkdir dir{1..10} && touch dir{1..10}/file{1..5} 2.Open 2 terminals parallely and redirect output to from one terminal to other A.  In linux every thing is tretaed as a file.So get the file corresponding to current terminal using tty command in terminal 1 and redirect ouput from terminal 2 to terminal 1         a)Open 2 terminals, either ssh sessions or 2 terminals        b)Execute tty command in terminal 1, it will display file corresponding to current terminal session          Eg:/dev/pts/1        c)switch to terminal 2 and execute below command        echo "This is sample text" >> /dev/pts/1        d)now you can observe the ouput will be redirected to terminal 1  3. Difference between mnt and media in linux file system, which is used for mounting If you plug in an external device it...

Storage Management in linux

 Add new disk to Linux:(Disk Management) 1.Traditionl fdisk 2. LVM Start reading those 4 blogs to cover all topics: Create partitions: here Extend partitions: here Delete partitions: here Logical volume manager: here dditional points I would like to add in lvm are: If you create partions using method one, then you need to pass option of parttions in pvcreate Eg: pvcreate /dev/sdb1 /dev/sdc1(Instead of /dev/sdb and /dev/sdc) If you follow method 1 for creating partitions, don't forget to use 'partprobe' command after creating partions using fdisk, because kernel shoud know the partions created. Extending LVMs: here 1.Traditionl fdisk Clear video: here   and clear notes here   and very imp notes here (Creating logical partions using extended partitions) In MBR partition scheme it allows us to create a maximum of 4 partitions only, in order to create more partition we have to choose the extended partition, from this extended partition we can create more logical par...