Which language will better to learn for a Linux Administrator job? Both, but BASH first. I am not a sysadmin--except on my own systems--but my rationale is simply this: I have installed and configured Linux at least 100 times in the past 5 years, and I have never learned Perl. On the other hand, it's hard to get thru a single day without doing something in the (BASH) shell. Which one is easy to learn? Both, neither, it depends (pick one)
Now, set aside all of what I just said.
--- Both would be good to learn. I tend to use both in my day to day job duties. I find that it's more convenient to use shell scripts for when I need to run lots shell commands or for wrapping several utilities together into one functional piece. However, if I need to do alot of text processing or data processing from files or outputs from other programs then I find perl to be easier to do that in. --- If you want easy to learn, learn Python. Bash is 100 times easier than Python or any other scripting/programming language. But that's taking into consideration that the power of bash relies upon the pre-compiled binaries of the system instead of the language's library of functions. Because of the power of 'sed' and 'gawk' among other things, bash can be used for small simple execution scripts, to simple decision making scripts to a full on cd auto ripper/namer/tagger (abcde). You could equally argue that perl and python can do every thing sed and gawk can do, only more intuitive; not to mention executing programs on the system. But what if perl and python are not on the system your are administering? bash (or some other sh type shell) is one thing that's guaranteed to be on all linux systems. Yes, aside from special one use things like embedded devices. Really though, it depends on what you are administering. The system in general requires simple scripts best suited for bash. However, if you need to actually make over 10 functions or start thinking about classes in your code, you may consider actually using a language supporting better organization. --- I have a Linux administration job. The machines I manage have loads of scripts on them that I've written to do various things like making sure custom config is in place, ensuring updates get installed (and notifying me if installation of updates fails), and some of them are even there to be run by the users to do something useful. One of these scripts is written in perl as an experiment, the rest are Bash shell scripts. If you can use the command line you can write a Bash shell script because a shell script is basically just a bunch of commands you could type in at the prompt one after the other all bundled up in to one file for convenience so you can run them all at once. (And so you can run them automatically.) You can even give your shell scripts simply GUI interfaces using tools like zenity, or make them pop up notifications on the screen using libnotify.
Certifications Questions
Have a Linux Problem
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|