------------------------------------------------------- Simple UNIX by aztek 1. Introduction 2. Shell Accounts 3. Navigating 4. More commands ------------------------------------------------------- 1. Introduction If you wanna be a hacker you are goning have to learn how to use UNIX. Considering that most of the computers you will be trying to hack will be using some type of UNIX on it would be a good have a little knowledge about it. What is UNIX? Unix is a powerful multi-user, multi-tasking operating system. Multi-tasking means it can run more than one program at a time and multi-user means that serveral users can be logged into a unix box at the same time. There are several types of unix. The different types of unix are known flavors or distributions. Some flavors are Solaris, HP-UX, IRIX, SunOS, Free BSD, and Linux. Commercial disto's of UNIX can be pretty pricey. But free one's like Free BSD and Linux can be download via public ftp sites for free or you can purchase them for about $40 to $70 and they come with a manual. -------------------------------------------------------- 2. Shell Accounts If you don't have access to a computer with unix on it you can go get a shell account for free. If you are new to UNIX you are probably wondering what a shell account is right about now. A shell account is similar to the dos prompt in windows. Except it is UNIX and not dos. A shell account is the unix operating system without the GUI. The term GUI stands for graphical user interface. An good example of a GUI is windows which is a GUI for dos. A way to look at is this. Windows is just a pretty picture between you and the dos prompt. To perform tasks in the Windows which is the GUI you do things like click on shortcuts and go to start/programs/whatever. To do things in dos you have to enter commands. Just about every thing you do in windows you can do in dos plus a little more. The same applies to UNIX. There are several types of shells choose from. Each one has its on advantages and disadvantages. Some of the common shells are: sh - Bourne Shell bash - Bourne Again Shell csh - C Shell ksh - Kourne There are some more shell but these are the most common ones you will run into. I would suggest getting a bash shell. Getting a shell account is fairly easy. I am not gonna go any further on this subject so I can do more for the rest of this tutorial. There is a great tutorial on getting shell accounts By BSRF http://blacksun.box.sk/shell.txt The rest of this tutorial is written assuming you have a nix box or a shell account. -------------------------------------------------------- 3. Navigating One of the first things you should learn how to do once you setup your nix box or get a shell account is how to navigate the file system of your computer. The commands you will learn to use : pwd, ls, and cd The command pwd stands for present working directory. This command will give you the path to your location from the root directory. To use this command just type pwd. here is an example of what i get when use pwd on my linux box: [aztek@localhost aztek$]pwd /home/aztek So to get to my current directory from root. You would go to the user directory then the aztek directory. This isn't a hard command to comprehend so I will move on to the next. The ls command list the files and folders in the directory you are in. If you are fimiliar with dos the ls command is the unix equivilent of dir. So after I determine my pwd is /home/aztek and I want to see what files I have in my directory I type ls. here is an example of what I get when I type ls on my linux box: [aztek@localhost aztek$]ls Desktop core files nsmail This is a list of all the files in /home/aztek. This list is very descriptive and would be hard to read if I had 30 files in this directory. So to make the ls command a little more descriptive I add the option -l. Which would be typed ls -l. can you tell the difference: [aztek@localhost aztek$]ls -l total 812 drwxr-xr-x 5 aztek aztek 1024 Jan 1 16:48 Desktop -rw------- 1 aztek aztek 823296 Jan 2 04:02 core drwxrwxr-x 2 aztek aztek 1024 Jan 3 09:46 files drwx----- 2 aztek aztek 1024 Jan 1 16:53 nsmail As you may have noticed this is a little more descriptive. The -l option lists file permissions, their owner(aztek), their group(aztek),size, and Creation Date. Some more options you can use are: -al (lists all files including hidden files) -s (organizes files by size) --color (categorizes files by color) The last command I will discuss in this section will be cd. The cd command changes your location to a different directory. So after I use the ls command I decide I want to move to the Desktop directory. I would type cd Desktop to perform this action. here is an example: [aztek@localhost aztek$]cd Desktop [aztek@localhost Desktop]pwd /home/aztek/Desktop --------------------------------------------------------- Note: Unix is case sensitive. If I would have typed cd desktop I would have gotten: [aztek@localhost aztek]cd desktop bash: desktop: No such file of directory --------------------------------------------------------- If I wanted to change directories to a file that was not in /home/aztek I would type cd and the path to that directory from root. So if I to change directories to /usr/bin I would type: [aztek@localhost aztek]cd /usr/bin or if you just wanted to get to root you would type: [aztek@localhost aztek]cd / -------------------------------------------------------- 3. More Commands This section of the tutorial describes some other useful commands that will make your UNIX experience a little bit easier. -------------------------------------------------------- cp The cp command copies objects. The syntax is fairly simple you just type cp the name of the file to copy and the name of the file to copy to. syntax: cp example: [aztek@localhost aztek]cp file1 file2 -------------------------------------------------------- exit When you are through just exit and it will close XTERM or telnet or whatever terminal emulation program you are running. example: [aztek@localhost aztek]exit -------------------------------------------------------- finger The finger command looks up information found in the /etc/password directory. syntax: finger example: [aztek@localhost aztek]finger aztek Login:aztek Name: aztek Directory:/home/aztek Shell: /bin/bash On since Thu Jan 4 19:02 (CST) on pts/0 from 0: No mail. No Plan. -------------------------------------------------------- man This command formats and displays manual pages. If you have any questions about a command or program that is in your shell just type man and the name of the command or program. If you want to stop reading just type q to quit the manual page. syntax: man example: [aztek@localhost aztek]man telnet -------------------------------------------------------- mkdir The mkdir command makes a new directory. syntax: mkdir example: [aztek@localhost aztek]mkdir myfile -------------------------------------------------------- mv The mv command moves and object to another directory. syntax: mv example: [aztek@localhost aztek]mv myfile /home/aztek -------------------------------------------------------- psswd This command changes your password. It will ask you for your current password and then ask you to type your new password twice. syntax and example: [aztek@localhost aztek]psswd Changing password for aztek (current) UNIX password: New Unix password: Retype new UNIX password: psswd:all authentication tokens updated successfully -------------------------------------------------------- ping This command sends and ICMP ECHO_REQUEST to a network host. There are some more options for this command. They are available in the ping manual. man ping. syntax: ping example: ping microsoft.com ------------------------------------------------------- rm The are rm command removes files and directories. When you delete something with rm it does not ask you are you sure if you want to and after you delete something there is no restoring from the recycle bin. So make sure you want to delete a file or directory before it is too late. rm with no options will only delete files. To delete directories add the -r option. syntax: rm rm -r example: rm myfile rm -r my dir -------------------------------------------------------- who The who command gives a list of all the user logged in. It also displays their terminal type, login time, and host name. example: [aztek@localhost aztek]who root ttyp0 Jan 4 11:44 (www.isp.com) jdoe ttyp4 Jan 4 09:31 (205.69.54.45) tux ttyp2 Jan 4 03:30 (www.linux.org) -------------------------------------------------------- After learning to use these commands you should be able to call yourself a UNIX user. Well that is the end of tutorial I know it sucked but maybe you got something out of it. -------------------------------------------------------- -Aztek