- 5paisa
- AdSense
- Android
- Asphalt 8 : Airborne Mod Apk 4.9.1b Unlimited Money
- Battlegrounds Mobile India
- Blogger
- Blogging
- Bug Hunting
- cloud storage
- Cmd
- Damn vulnerable Web Application
- Demat Account
- Difference between
- dj alok
- dj alok in free firefree
- Doodle Army 2 : Mini Militia 5.2.0 Apk + Mod for android
- DVMA
- E-books
- earn Bitcoins
- Ethical hacking tutorials
- Express vpn
- EXPRESSVPN PRO APK 7.12.1
- EXPRESVPN CRACKED APK
- fire dj alok
- Freefire
- Gaming
- Google drive
- Google llc
- gplink
- Groww App
- Health
- helo
- helo mela
- helo app
- Helo app earn paytm
- Helo app full guide
- Helo app invite and earn
- Helo app redeem proof
- Helo app refer and earn
- Helo app unlimited trick
- Helo app withdraw proof
- Helo Mela Offer: Get Rs.2 Free Paytm Cash + Win Upto Rs.10000 Paytm Cash
- helo refer and earn
- How to
- How to combine two Wifi Connections to get a faster Internet
- how to get dj alok for free
- how to get free dj alok
- how to get free dj alok in free fire
- How to install DVWA on Kali Linux 2020.2
- How To Use Light Speed WebCache on Your website
- ICICI Direct
- IOS
- kali linux
- Live streaming
- makeup
- meesho
- Money Earning
- My poems
- Netflix
- Netflix mod
- Netflix premium
- News
- online courses
- Pentesting
- programming
- PUBG
- Puffin Browser Pro 8.3.0.41446 (Full) Apk + Mod for Android
- Puzzles
- Recharge offers
- Refer and Earn
- Reviews
- SEO
- shell Scripting
- Shortlink
- Spotify Music 8.5.57.1164 APK Mega Mod Cracked Latest Android
- stylish name
- Technology
- Tips&Tricks
- Township Mod Apk 7.5.0 Unlimited Money
- Udemy
- Udemy courses
- Udemy free
- Udemy premium
- VClip app download link
- VClip app full details
- VClip app invitation link
- VClip app referral code
- VClip app referral link
- VClip app review
- Web designing
- What is
- WINDOWS
- Wishes
- Wordpress
- World Cricket Championship 2 2.8.9 Apk + Mod (Coins/Unlocked)
- Youtube tricks
- zoom app
- zoom bombing
- zoom call
- Zoom safety tips
How to Executing commands in a shell script
Hello guys in this tutorial we are going to discuss about executing shell scripting.so far we have learned basic concepts including syntax.now let's do some tasks in pro way.
By using this method you can executive multiple commands at time.
Ex: Kumar is watching Tv and drinking coffee.
let's go in code way.
Just place commands in bash script
This code is quite easy to memorize.Have a try on it.You need to write commands in a specific order to run and execute.
#!/bin/bash
ls-l
mkdir
linux java
free -m
who
where in 1st line indicates shebang also called bash interpreter
in second line ls is a commandto list content in current directory.
in third line mkdir will create two directories named java and Linux.
in Fourth line free-m shows freespace in Ram,Rom,Hard disk.
However you write code then the terminal execute that commands in that pattern.write code in pro way with your creativity.
Upgrade Linux using bashscript to new version.
By using this command it deletes the old Linux package and updates to new version.The code is quite lengthy.Just paste below code in terminal and hit enterapt-get clean && apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
Lets Copy files with shell scripting
#!/bin/bash
echo "Enter file to be copied"
read old
echo "Enter new file name "
read new
if cp $old $new
then
echo "file successfully copied"
else
echo "file does not exits"
fi
Where first line ask user to enter the name to copy but it must be in present working directory.
Where Second line stores back up file name .
if statement can be used to check whether if operation has successfully been performed or not, if operation is not successfully performed then it shows error result on output screen.
you can use mv command for renaming and -r for copying and renaming current directories.
conclusion
I hope you may loved this cool post.If you have any doubts post in comment section.
Please check out advertisements on our website which helps us to post more content for you .
Don't forget to share this cool post with all your friends and groupspread. HAVE A GREAT DAY.
Also Read
KUMAR JEERU
. I am a Programmer and Pentester. I find and Fix loophole in websites and networks. Connect with me for queries , web developemnt , Scanning and Fixing website Security issues. My company gives special discount for independent entrepreneur , small and Medium size companies. Contact me directly on my face page
Post a Comment
Post a Comment