Getting more from your Linux or Unix shell
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4043
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
There's a good beginner's tutorial on Getting more from your shell. There's some pretty good information there, stuff you'll use all the time like how to setup aliases, functions, etc.

:: Quote ::
Yet people often learn the few commands they absolutely must — just what they need to, say, read mail, start their editor, and print documents— and leave it at that. Indeed, nowadays, with the spread of sophisticated GUI environments in the Linux and Unix world, many users never so much as see a shell prompt.

In this article, I'll focus on three areas in which your use of the command line can be made more productive: editing the command line, using aliases as shortcuts, and a gentle introduction to shell programming in the form of a guide to simple shell functions that can be included in your init file .

I've found that every shell command you learn is one more key to getting both increased understanding of your OS and much improved ability to do things very quickly. For example, if you have apt on your Linux system, all you have to do is type in a few characters to install any application, or even update the whole disto, in one operation.

Then of course there's the more advanced stuff, which I have yet to learn, but which helps even more in terms of automating things you do all the time.

:: Quote ::
The shell is a programming language, remember, so it's only natural that it should have functions. The syntax for functions is simple. A function defined in the shell looks not dissimilar to the way it would be defined in the C programming language: the function name, followed by a pair of parentheses, then the body of commands that make up the function enclosed in braces.

Functions are a natural progression from aliases, and avoid the overhead of a shell script at the cost of a bigger environment.

Anyway, nice stuff, I'll be checking that article out more in the future, there's a lot of material to absorb, that's a good start when it comes to using your shell.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours