ZeroCold Posted March 14, 2010 Report Posted March 14, 2010 Linux Terminal IntroductionA beginners introduction to the very powerful linux terminalWelcome, I've noticed a lack of linux articles on this site, so I thought I would post one (although its rather basic, it should definitely help people new to linux). If you are in a windows environment, and still want to try this out for yourself, there is a program called cygwin (Cygwin Information and Installation) which provides a linux-like environment in windows. If you looking to try out linux, there is a very user friendly distribution called ubuntu (Ubuntu Home Page | Ubuntu), which you can run with no changes to your system. Linux is not *all* command line, if anyone who reads this happens to be that oblivious. In fact, the linux GUI's (there are multiple avaliable) can do alot of things the windows one cant.Now, enough introductions and windows ranting You can get to a terminal in linux by pressing ctrl+alt+F1 or by searching through your programs list for something such as "terminal" or "konsole"When you open your terminal, you might be wondering what the first thing you see is supposed to mean:Your's will be different, and its called a prompt. It tells you information about your computer and who and where you are in the system. This is the syntax:USERNAME@HOSTNAME:CURRENTDIR$You might be thinking: "What kind of directory is ~??". Well, in linux "~" is a shortened way of saying "your home directory". For instance, mine *actually* is: /home/stealth/, but it becomes tiresome to print and read constantly, so they use a much shorter character.lsThis is the most common command for me. It's a cut down form of the word LiSt and does exactly what it sounds like, it lists the contents of the current directory. You should see exactly whats in your home directory. Now, this is a command that takes "arguements". You can give it sub commands to get exactly what you want.ls -aThe - means that i want to start an arguement, and the "a" is the specific arguement, in this program, "a" lists all the directories. By default, ls hides the hidden directories (ones that start with a ".").cdChange Directory. This command allows you to manuver through your filesystem. / is the root directory in linux. Linux does not use C:/ or D:/ *drives*, but instead it uses mountpoints. Each drive will be *mounted* under a position in the filesystem (most likely /media/). So, if a device, called "device", was plugged in and mounted, and you wanted to go to that directory via command line, you would "cd /media/device/". Then, your terminal might look something like this:Pretty cool, huh? This is not even the tip of the iceburg. The linux console controls *everything*. Lets say you wanted to run a program, you can run that program just by typing its name:However, what if you dont know the right program command?Okay, bummer. So what can we do? Bash (the terminal) comes with something called tab-completion. Basically, if you dont know the whole name of a file, command, program, etc (or are just to lazy to finish typing), pressing tab will let bash finish it for you.There was more than one possible outcome that bash could have entered for me, so rather than guessing one, it told me the possible outcomes. You might not have open movie editor installed on your system, so that particular scenerio might have gone differently for you.Another great command is "cat". Cat prints the output of a file.Now, if I opened /media/device/fire4.txt, I would see that the file contained "You idiot your spelled file4.txt wrong!".Another great command is "nano". nano is a text editor that allows you to edit files, or create them. Once in nano, it takes up your full screen, and you can get out by pressing ctrl+x, then pressing y or n to save or not save your file (if you made any changes). Also, you can delete files with the rm command. The -r will delete things recursively, meaning that it will delete things in sub-directories (useful for deleting directories which aren't empty), so be careful. Like I said, the terminal can be very powerful (which is why I wont explain the su or sudo command here).One last command I will teach you is "man". man stands for MANual. Typing "man commandhere" will bring up the manual page for that command. The manuals are extremely detailed and teach you everything you need to know about that command. Some commands I recommend looking into are: mount, sudo, su, umount, ssh, the program installer for your distro, touch, and mkdir. Quote