Shell Scripting: Really Programming The Shell

When you open up a terminal window on your Linux system, you are opening up a programming environment. While it may seem like just this place where you type commands to list your files or check on the amount of disk space you have left, the shell is a real programming language. True story.

Shell Scripting vs Programming, part 3 - Special Things

When you talk about shell programming, or any kind of programming for that matter, you are going to deal with variables on different levels. In the shell, you have the built-in variables you saw earlier, and you can assign variables as well. For instance, without writing a script, type this line at your shell (command-line) prompt:


Then type this:

Shell Scripting vs Programming, Part 2 - Parameters and Variables

Welcome back to my Shell Scripting vs Programming series. This is part deux.

Shell Scripting vs Programming

It's time for a new series focusing on the Linux shell. In my last series, I taught you how to work in the shell to manipulate files and directories, execute commands, find things, and work with a powerful editor. This time around, I'm going to talk about programming in the shell.

Mastering the Linux Shell : Killing Processes and Dire Warnings

Today's installment of Mastering the Linux Shell comes with a warning. Actually, it comes with a few warnings. .And a viewer advisory. Well, actually a reader advisory. 

Mastering The Linux Shell - Processes

So what constitutes a process on your Linux system?  The short answer is : Everything

In your long and illustrious career as Linux gurus, you are going to hear a lot about processes, process status, monitoring processes, or even killing processes. Gasp! Reducing the whole discussion to its simplest form, all you have to remember is that any command we run is a process.  Processes are also sometimes referred to as jobs. 

The session program which executes our typed commands (the shell, or terminal if you prefer) is a process.  The tools I am using to write this article such as my desktop, the browser, the server somewhere out on the internet . . . these are creating several processes and sub-processes.  Every terminal session you have open, every link to the Internet, every game you have running, the little clock in the corner; all these programs will generate one or more processes on your system.  In fact, there can be hundreds, even thousands of processes running on your system at any given time.   To see your own processes, try the following command.

Mastering The Linux Shell - Advanced Permissions

In my last article, I introduced the idea of permissions in the Linux world. Some users can read or write a file, while others can only read the same. A user may also belong to a group and share the permissions of that group which might also involve the ability to execute, or run a file as a program.

Mastering The Linux Shell - Getting Permission

Under Linux, access to files and directories is controlled by a system of permissions. Those permissions define who can see a file, whether they can modify it in any way, and in the case of some files, whether the commands within that file (or the file itself) can be executed. By executed, we mean "can we run that program?".

Mastering The Linux Shell : Standard In, Out, and Error

Welcome to part four in my Mastering The Linux Shell series where we will wander wistfully into a land where three terribly under-appreciated but vitally important files live. You will remember that everything is a file, including directories which some people call folders. What you may not know is that your keyboard is a file, as is the screen on which you read these words.

Mastering The Linux Shell : Making Things Disappear

Information begets information and eventually, there's just too much of it. I don't really believe that -- I'm an information junkie -- but there's no question that if you never delete anything, eventually, you will either use up all your disk space, or you'll have a terrible mess on your hands.



Subscribe to RSS - shell