Published on March 11, 2017 by ProgrammingKnowledge
Want create site? Find Free WordPress Themes and plugins.

For more detailed Tutorial visit – goo.gl/vn9xIb

Shell Script has many operators that you can use to test different aspects of a file. For example, you can use the -e operator to ensure that a file exists before deleting it. Or, you can check that a file can be written to before appending to it. By checking the feasibility of the impending file operation, you can reduce the number of errors that your program will encounter.

My Website – www.codebind.com
My Blog – goo.gl/Nd2pFn
My Facebook Page – goo.gl/eLp2cQ
Google+ – goo.gl/lvC5FX
Twitter – twitter.com/ProgrammingKnow
Pinterest – goo.gl/kCInUp
Text Case Converter – goo.gl/pVpcwL
Epoch Timestamp Converter – goo.gl/Zedjo5
Decimal – Binary – Hexadecimal Converter – goo.gl/rkX3JE
8-bit Checksum Calculator – goo.gl/inxvIT

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

11 Comments on "Shell Scripting Tutorial for Beginners 6 – File test operators"

Notify of
avatar

ravi teja
Guest
ravi teja
1 month 24 days ago

hello sir, i want to know how to test a file whether exist or not when the file name is given from command line arguments not by us. how program for it.thanks in advance

Xieerqi
Guest
Xieerqi
3 months 6 days ago

On 7:10 mark author of the video states that character special file is a normal file which contains text, while block file is file like video or picture file. That's not true. Block files are used to represent partitions of a hard drive, usb sticks, memory devices,etc. Character devices are typically consoles, like /dev/tty1, or devices that generate characters such as /dev/zero. Thus, -b flag will not work on video file but will work on partition file such as /dev/sda1. Video and text files are still considered regular files, not character or block.

Gleb Bondarenko
Guest
Gleb Bondarenko
5 months 3 days ago

Instead of echo -e "… c"you can useecho -n "…"

Ergis Hotza
Guest
Ergis Hotza
7 months 9 days ago

Very well explained thnx

Mohammad Faizan
Guest
Mohammad Faizan
7 months 10 days ago

Nice…Very understandable..Thankx

faiz shaikh
Guest
faiz shaikh
7 months 11 days ago

ECOMMERCE BASED…

faiz shaikh
Guest
faiz shaikh
7 months 11 days ago

PLEASE….

Anonymous
Guest
Anonymous
7 months 11 days ago

is it helps for marketing sir?

lexand007
Guest
lexand007
7 months 11 days ago

Learn marketing with shell? I don't think it's the best idea.

Ajmery Yeasmeen Bithi
Guest
Ajmery Yeasmeen Bithi
7 months 11 days ago

i wanna learn about marketing please help me.

faiz shaikh
Guest
faiz shaikh
7 months 11 days ago

SIR MAKE AN PROJECT IN ASP.NET MVC ….

wpDiscuz