![]() |
![]() |
|
Basic Linux CommandsGetting started: OK, so now we know how to get into our UNIX shell account. If you have not got one, click here. This is good. Let's continue. Please note: ALL commands that are within quotations need to be entered on ONE LINE. If they appear to be split over 2 lines, in any lesson, that is because of HTML formatting.
Now, you might be wondering what all that was about. If you did not do the exercise above, please do not read on. Go do it. It takes 2 minutes. Explanation: To start, I would like to emphasize one fact: UNIX is CASE SENSITIVE. And, most UNIX people like lower case letters for everything, so get used to it. The "ls" command will be one of your most frequently used commands. It is used to list files. You will also usually add the "switch" or options "-la" after the command to get more information about the files. In UNIX, if you name a file starting with a period (e.g. .blah) it will not appear in a regular "ls" command. It is the equivalent to a Windows "hidden" file. Now, if you are very used to Windows, you are probably wondering how you can name files after the period with something like "blah". Well, in UNIX, there is no concept of "file extensions", at least not in the Windows sort of way. For example, if you have a zip archive on your UNIX machine, you can rename it from "whatever.zip" to "whatever.bob" and you could still use the UNIX unzip utility to unzip it. In general, you can name your files with whatever file extension you want, but you should still try to name your files properly. For a good listing of common UNIX file extensions and their meanings, visit THIS SITE. So, if you want to see all of the files in a directory, including the "hidden" files which begin with a period, then you will want to use an "-al" switch with your ls command. If you are familiar with DOS, then you already know the "cd" command. It stands for change directory. On the command line, you enter "cd" and the directory you want to go to. If the directory you want to go into is within your present directory, then you just need to put the name of the directory there. If you want to switch to a directory that is not located within your present directory, you will want to enter the full path. For example, if you are in your home directory, "/home/yourName" and want to go to the configuration file of the Apache webserver, you would type in "cd /etc/httpd/conf"; you can not simply type in "cd conf". Finally, let's discuss the "man" command. "man" stands for manual. Most commands and programs in UNIX and Linux have a manual page dedicated to them. For example, if you typed in "man ls" you should be shown the manual page describing the "ls" command. The pages are usually quite cryptic for novice Linux administrators, but soon they will be your best friend. If you are not at a command line, you can still view the system's manpages on our site. Go to our Man Page Viewer and type in any command you are curious about. We will also try to link to our online man pages when new commands are introduced. Try to read the man pages for as many commands as you can. They will help you get used to using the manual pages and should help you learn more quickly.
|
| If you do not have your own linux server, you can get a shell account through us and learn UNIX quickly. |
|