err... What's the Linux equivalent of a windows batch file?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
err... What's the Linux equivalent of a windows batch file?
Hi, I'm trying to install a shedload of .deb files that I'm downloading, is there a way of typing out a batch file type thing which can install all of them without me having to type dpkg -i package_name.deb a squillion times?
Also, I'm having to download the deb files on my windows PC then transfer them by disk so... um... is there any way I could write out this batch file in a windows environment? or would I have to use a program inside my Linux install?
is there a way of typing out a batch file type thing
We call that a script....
When Bill was in diapers and there was no DOS or Windows, the Unix elders also called it a script. So clearly, it is the MS world that is the abberation....
What's the Linux equivalent of a windows batch file?
I would paraphrase that question as
What is a Linux scripting language that is badly documented, internally inconsistent and not very powerful?
Sorry, you can find plenty of Linux scripting languages that are as badly documented as the Windows batch file language, but I don't think you can find one as internally inconsistent and lacking in power.
Seriously, bash scripting seems to be the most popular Linux tool filling the role of advanced .bat files in Windows.
But bash scripting is lot more powerful and complex than .bat files, so there is far more to learn. Hopefully you can find a simple subset of bash scripting that is easy to learn while already being more powerful than .bat files.
Anyway, there are several choices of "shell scripting" languages (such as bash) as well as other scripting languages. It sounds like your current task barely (if at all) needs scripting. Learning a little bash scripting is a good idea even if your current task doesn't require it.
Note that at the basic level a script is really just a file holding a series of shell commands to be executed, so most everything you can do in the shell can also be done in a script, and vice-versa.
I highly recommend linuxcommand.org as a good introduction to the bash shell and scripting. It will give you everything you need to know to get started.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.