Don't be afraid of the Linux command line Raul Suarez September 19, 2009
2 About me ➲ Computer hobbyist Since 1982 ➲ Computers professional since 1987 ➲ Linux user and advocate since 2005 ➲ I prefer conversations than lectures, let's make this one a conversation
3 Overview ➲ Most new and some old users feel puzzled by the command line ➲ I hope that today you will leave with a better understanding of it so you feel comfortable using it when appropriate ➲ In my case I don't always use the command line, but when I do, I'm glad it's there ➲ At the end of this talk you should be on your way to understanding commands and simplifying your work using the command line
4 Agenda ➲ What is the command line ➲ Why and when to use the command line ➲ How to interpret commands ➲ Tips and tricks
5 What is the command line ➲ It is an application that lets you execute commands by typing them instead of selecting from a menu ➲ Other names: ● Console ● Terminal ● Command window
6 Why and when to use? ➲ Someone tries to help you by giving you a command to execute ➲ You need to do repetitive tasks ➲ You are faster typing than moving the mouse
7 Interpreting commands cd ${OLDPWD} && ls -la > ~\dir.txt ps -ef | grep bash >> ~\dir.txt ➲ Command components ● ➲ More than one command in one line ● Sequence ● && : Only execute the next command if the previous executed correctly ● || : Only run the next command if the previous command failed ● Redirection ● > : Send the output of command to the right side file, overwriting ● >> : Send the output of command to the right side file, appending ● Pipe ● | : Send the output of one command to the input of another ● Variables ● $name or ${name} : Substitutes with the value of the variable ● ~ : Substitutes with the user's home folder
8 Tips and Tricks ➲ Tab, arrow navigation, Ctrl-R ➲ You can get a command documentation with the command man e.g. man grep ➲ Most commands have a --help parameter e.g. grep –help ➲ You can “store” aliases frequently used commands e.g. alias lax=“ls -laX” ➲ Search the web for help
9 Closing remarks ➲ The command line looks scary but it can actually help you to be more efficient ➲ Understanding the structure of the command line will help you understand what a command does ➲ You don't need to know all commands, looking at the help one at a time is more than enough ➲ There is a lot of help around
10 Thank you! More questions? ➲ Sample article ● _ html _ html ➲ Handy commands ● ➲ Raul Suarez ➲ The working centre ➲ Kitchener-Waterloo Linux User's group