Unix

  • An Introduction to UNIX, and Linux
    • Unix has emarged from places like At&t and Bell labs. It was an oparating system that would be free.It was licenesed under a general public license. This ment that unix and any part of the code could be changed, without any license issues. This operating system was done with a yet to be most popular high level language software, namely C language. This has enabled programers to write code that didn't need an asambly language and was independant on the hardware variations. Thanks to all of this, Unix as well as C gain its popularity and now Unix and its child Linux are being used all over the world.
    • Linux initially refered to kernel, but later it commonly describes unix like operatin systems. The difference between Unix and linux is the fact that undernith linux there is unix.Linux was created by adding graphical interfeces to unix. The most popular graphical interfeces are KDE and Gnome. ALL distributions can run almost ANY graphical window manager, so the distribution will not limit you there. Gnome, KDE, XFCE, etc. all run fine on any distro. The difference between different Linuxs is the way they are being put together, and what kind of programs and update system they use. When picking a distro you are really choosing the package management system (like “windows update” in windows, but affects all installed programs) and the general setup of the system (file locations occasionally vary from distro to distro).
      • After you choose the disctribution you can download free linux from places like :
      • Here is a discription of linux disctributions(versions of linux):
        • The Fedora Core is a Red Hat sponsored and community-supported open source project. It is not a supported product of Red Hat, Inc. The goal? Work with the Linux community to build a complete, general purpose operating system exclusively from free software. Public forum. Open processes. A proving ground for new technology that may eventually make its way into Red Hat products.http://www.redhat.com/fedora/.
        • Debian Linux is yet another distribution of a linux.It seems to be targeted to end users and server administrators. Also apt-get, the package management system debian uses, is pretty good IIRC. This distribution is know to have least restriction on license issues, it need to be manually set up(detailed). Therefore it is mostly used for server purposes. http://www.debian.org
        • RedHat is a paid Linux distribution. It was created by RedHat Inc, and the main target of this distribution is comercial use. It includes a technical support avaliable 24h, automatic update and notification on security vornulabities or updates. All this is being done throught RedHat update utilities.
        • ManDrake is another distribution that has its own fan base.
        • SUsE Fast and secure, SUSE LINUX Professional 9.3 from Novell includes an operating system, more than 1,000 popular open source applications and improved support for mobile devices. Use SUSE LINUX Professional 9.3 to browse the Web, create and share documents, work with graphics and multimedia files, configure home networks, and develop applications. This is a most easies desktop linux for begginers. It is easy to install and menage. Although if you plan to use it as developing platform or a server, you need to specify additional software that you want. This is easly done too. Read more.http://www.novell.com/products/linuxprofessional/
        • Gentoo, but it's not for the faint of heart. If you are familiar with compiling packages and debugging problems go for Gentoo. It's hand's down the best system out there if you want to build your own system.
        • Check out http://distrowatch.com for more distros.
      • Side note:If you're a mac user, than YDL (Yellow Dog Linux) is Redhat-derived. On the PC, the only alternative to Redhat that is Redhattish is Fedora. If you want the same package management (RPM), then look at popular distributions such as SuSE :) or Mandrake. Some of us are Slackware and a Debian user. “I like Slackware because it has the clarity of a BSD system” - i.e. the config/init files are simple, concise and comprehensible without having to exert effort. “I like Debian because it's sort of a install-and-forget distribution. If my WD disk didn't flake out on me, I would be a two years running Debian.” Maintenance and upgrades are hassle-free, and the amount of packages offered can only be matched by Gentoo or one of the BSD ports/pkgadd systems

Free Software for Linux, and other Operating Systems

  • Open office is a popular and free alternative to Microsoft's Office Suite. It was orginally created and maintained by Sun Microsystems. Open Office is also seen by some as a bloated, slow office suite, but it has many options and version 2.0 shows its big improvments. There are a lot of windows users who use open office if they are looking for a FREE OFFICE. An alternative to word processing is Abiword, which is an excellent stand alone word processor.
    • Firefox is an alternative web browser to Microsoft's dominant Internet Explorer. It is fast, friendly, fully standards compliant, and 100% free. Unlike IE, Firefox does not suffer from as many critical security issues. It is also highly customizable, you can visit https://addons.mozilla.org/?application=firefox for many add ons , and themes. If security is one of your issues, use firefox. You will have less problems to wory about, and more functinality to use.
    • Firefox Information: http://www.firefox.org
    • Opera is another alternative web browser. It is very fast, standards complaint, and works across all major operating systems. Unlike Firefox, however, it is a commercial product. This means that while you can run it for free, unless you purchase the paid version you will have advertisements shown in the upper right hand corner of the screen.
      • You can find additional information about Opera at: www.opera.com
    • Thunderbird is a free email client, created by the Mozilla Foundation. Very good and highly customizzzed program. As well as firefox it can be downloaded for any platform. (Win, MAc and Linux)
    • Evolution is another free email and scheduling client. It was created as a direct competitor to Microsoft's Outlook. It even supports Microsoft's Exchange server. At the moment, it only runs on Linux, but there has been recent effort to port it to the Windows desktop.
    • Gaim is a free chat client that allows you to use AOL Instant Messenger, Yahoo's IM, MS's IM, ICQ, and others all in one place.

The Command Prompt

(aka “that black window thingy”) is a window that takes you to unix (text version as many call it), everything is represented as text and text is what you see. It doesn't get any better.

  • When opening terminal (command promt) you are in unix mode. ”/home/xx/yourname>” tells you that you are in the directory yourname, which is in xx and both of them are in home directory.

A Quick Introduction to Standard UNIX Commands

  • If there is one command to know when you learn UNIX, it is the 'man' command.
  • Man is short for manual pages.How do you use it? Just type in man and then the name of a command you want to find information on.
  • Here are sample comment 10 commands to get you going:
  • Output redirection is one of the most powerful abilities of a UNIX shell. This allows you to take the output from one command, and pass it into another command. Why is this useful, you ask? UNIX comes with many, many tiny utilities that are designed to do just one thing, and do it well. We have commands to sort input, search it, format it, and do everything else.
  • Lets take an example. Say you're working for a group, and you have access to a command that prints up the schedule for everybody working in that group for all days in all places. When you type the command “hours” in, you see 600 lines of output. What are you to do????
  • First lets simplify it a little bit. Perhaps you just want to see your own hours. You can type in

“hours | grep my_user_name_here”

  • The vertical bar (pipe) is the output redirector. The way this works is the shell executes “hours”. All of the output from hours is not shown, however. It is redirected to the command grep, and grep searches the input for the pattern “my_user_name_here”. Now since there is no more redirection, grep will print its output to the screen. What do you see? Only my_user_name_here's hours!
  • Perhaps you're more ambitious. Perhaps you want to see only your hours on a certain day. Not to fear! You can simply redirect output multiple times! So, this time you take the last command, and add another grep on… perhaps

“hours | grep smacdo2 | grep Tuesday”

  • Now all of smacdo2's hours on Tuesday will be shown. Simple, isn't it?
  • Now lets throw a curve ball in. What if, for whatever reason, you have 40 hours? And they scroll by too fast when you do “hours”… you want to be able to move up and down the list. There's no need to fear… the commands

“more” and “less” come to your rescue! Just type in

 "hours | grep smacdo2 | more" 

Ta-da!

  • Now that you've seen the power of output redirection, you're probably wondering just what kind of utilities you have at your disposal to do all of those nifty things. Well, here is a good list to start with! (TO-DO: fill out descriptions… I'm feeling lazy after wrighting all of that)

more

 less - "The more powerful version of more"... get it?? ;)
 grep
 sort

More Usefull Commands

 ls 
* **List the content of current directory.** So when you type 
  "ls" 
you should see what is in directory. When you type
 "ls -l" 

you will see the current directory, with permisions, user who owns it, time modified, size. Just try it “ls -l”. If you need more options type “man ls”.

 cd
* **Takes you to the directory you point to**. If you are in home directory aka /home/ and you want to go to your name you type 
 "cd foldername" where "foldername" is a folder you want to enter.

To leave the directory back to home you type

 "cd .." don't forget the space between "cd" and ".."
* Since you get faster at working with them **try these:**
 "pwd" : (Print Working Directory) Simply spits out the directory you are currently in.
 "who" tells you who is loged in into the same machine.
 "write" sends a message to other person.
  * If your friend user name on Linux is "acmuser". If you type "write acmuser" you can send a message to that person. Your message will be displayed on his screen. You end by pressing Ctrl+C. This is a nice way to bother people lol. Don't tell nobody.
 pine (not on all linuxes) is a email program. 
  * It is a simple text email editor. You are able to send, recive, delete email messages recived by your server. (In our case icarus or acm.) This program has also some connection with mime....not sure yet
 "pico" is a common mail reader on unix systems. 
  * It is a text based system, but has all the trappings and dressings of a modern GUI based mail reader. It can also read your news!
 "mv " stands for move. 
  * Using mv, you can move files and folders around your computer. Unlike copy, move does not create a copy. Move MOVES the file. Note that this is the DOS equivilant of rename.
 "rm filename" 
  * removes / deletes a file. "rm * -r" will delete every file in the directory and derectory below it. ALL directories contained within the current directory will be gone. This is very powerful, but can be equated with the "nuclear option"! If you do this as root(THE MASTER OWNER) with your current directory as '/', you will delete your ENTIRE filesystem! :D
 "rmdir " deletes a directory. 
  * Note that the directory must be empty before you can delete a directory. 
 Commands have their own manual pages. 
  * Simply type in 'man command', except replace command with the command you want to look up.

*Here is how to look for something in unix:

 grep is the unix user's most powerful tool. 
  * It lets you take any form of input passed to it, and use search patterns known as regular expressions to search through the text.
 find searches a specified directory, or set of directories to find a file with the specified pattern.
  * Here are some examples for using grep
 a) cat *.txt | grep termcat ~/code/*.c | grep -n "sprintf"
 # Find all lines #s with the occurance of "sprintf" in all c files in your "code" directory 
 b) ls -al | grep -v ".pl"
 # List all files in a directory that do not contain ".pl" 
 c) cat hello_world.pl | grep "printf" | wc -l
 # Count the number of lines "printf" occurs in hello_world.pl 
 d) env | grep PATH
 e) ps aux | grep smacdo2 - shows all processes owned by "smacdo2"
 f) w | grep smacdo2 - show all active logins from smacdo2
 g) ls -al | grep text 
 
  * Here are 5 other combination for find
 a) find ./ -name aloe.plant
 b) find ~/code/ -name "types.?"
 # List all of the files in the code directory named "types" with 1 character as the extension 
 c) find / -type f | xargs grep -n "strcat(" /dev/null
 # Find every file on the computer that contains the word "strcat("
 and print out the line number/file which it occurs 
 d) find /usr/sbin -perm 777
 # Find every file in your /usr/sbin directory that is world writeable, readable and executable 
 e) find /var/backup -newer oldfile
 # Find every file in your backup directory that is newer than "oldfile" 
 
*  Here are special way of using files with space,$,/ in a name....

To find such a file, you need to escape the characters so that the shell doesn't process them. The way to make sure those characters do not get processed by the shell is to add a \ in front of them. eg: find Hello\ World.txt Same concept applies to many other characters too, including parenthesis & square brackets. /

 $
 \
 space

File Editor

  • Here are othe file editor:
  • VI is the lightsaber of text editors
  • “This is the text editer of a Jedi Knight. Not as clumsy or as random as notepad, but an elegant weapon for a more civilized age. I has many options that range from cat and paste, to search, replace,
  • Emacs is another test editor that has similar options as VI. It has a different structure which differes from VI in a following way: ….
  • Vi or Vim
  • was created
  • basic structure is …
  • sample 10 comands are:

+ /name does + press 'i' to be in insert (writing) mode + press 'r' to be enter replace mode. Simply highlight the character you want to replace, and then type the character you want it to be replaced by. + esc to leave insert (writing) mode + w ('write') saves your file + q exits + q! will exit without saving changes + You can combine w & q → wq to mean “write, then exit” + u undoes the last command + x will delete the character under your cursor + dd will delete the line under your cursor + other

  • Emacs

o was created …

o basic structure is...
o sample 10 comands:
  + anybody used it?

Compression / Decompresion

  • “tar” Tar actually doesn't compress. It only archives files. So, a .tar file will pretty much take up just as much space as the files combined. You ususally compress a tar archive, too, to save space. Usually either gzip or bzip2 are used for that. Modern versions of GNU tar have that built in as -z for gzip and -j for bz2. Sometimes gzip'd tarballs have their extensions shortened to .tgz.

Folder can be ziped by writing

              + tar -czvf new_file_name.tgz folder
                    # "czvf" compress zip verify files 

o Which one of the copresions you use kinda depends on what you value more, time or space. bzip2 will compress more, but takes more time to compress and uncompress then does gzip. You'll sometimes find both avaiable for download (i.e. both a .tar.gz and a .tar.bz2);gzip seem usually the best choice given speed vs. compression ratios. Also, one other format that should be explored is “rzip” and “7z”. o To uncompress: tar -dzvf namesample 10commands are:

        o dzvf decompress ziped verify files 
* What are rpms? RPMs are red hat or other operating system alternative way of installing software. They are supposed to be an easy way to get programs onto linux. The downside is that they are horrible about dependencies. They dont check for any or install any. RPM's are little better than downloading the soure and building it yourself.
 o Alternatives are apt-get from debian which does do dependencies and is really easy to 
   use, portage from gentoo which is like apt-get to my understanding and ports in BSD 
   which is another way which is almost as easy as debian or gentoo. Which one you can 
   use depends on which distro you have but RPMs pretty much suck.
 o Redhat uses rpm binaries to install programs.
 o Gentoo uses scripts (portage) to install from tar balls (source)
 o debian uses its own binaries called deb files, but better with dependecies than redhat ? 
 Suse uses its own rpms. Not sure how suse handles its dependances. 
  • How can i compile from source?
 o You use the make utility. Make automates all the things that you have to do to 
   compile and install a program.
  • you can compile from source

o SpaceyMcCow

 o make
 o make install
 o make clean
     + The initial make compiles it, make install moves everything to the right place
       to use it and then make clean cleans up all the extra garbage. 
 o install does
 o ./configure Frequently you have to run ./Configure first which will qualify your OS 
   and libraries for the software you are compiling. Look at the man page for make.
 o Though, you really should try to use whatever package manager your distribution uses 
   because satisfying dependencies for source installs is a pain. Package managers like 
   rpm's, .deb's, Debian's apt-get, Gentoo's emerge, etc. are there for that reason 
   (among a few others). apt-get and emerge are spectacular at handling dependencies. 
  • To access rpm configuration you type “thank you acm@uic” it takes you

o To remove you do:

  o To add you do
  o To update you do: 
* shell is a ...
  o sh is
  o bsh
  o other 
* SSH is used to
  o here how its done 
* ftp is used to ...
  o here is how its done

Fifth Time Unix

  • To create web server you need Apache:

o you get it from: http://httpd.apache.org/

        o it works this way:
        o http.conf is a ...
        o update 
* to create mail server, you can use several popular email servers, which include sendmail and qmail.

QMail was written by professor Bernstein of UIC. Qmail is widely seen as the more secure alternative to sendmail, but sendmail has more features.

        o You find Qmail at www.qmail.org, and http://www.sendmail.org/.
        o you configure it ...
        o you use it this way..
        o you add modifications...
        o update 
* to create dns server you ...
        o you download it ..
        o you configure it like..
        o modify
        o update
        o menage 
* to create ftp server you...
        o do this to apache or 
* to create php/mysql
        o download this from:
        o install
        o configure httpd.conf
        o secure by.. 
  • If you are interested in anything web related, check out SIG-WEB. SigWeb meetings are a great way to find people like yourself - those interested in anything from web design to web scripting to full network programming. If it has something to do with the internet, sig web is your group!

o Home: http://acm.cs.uic.edu/sigweb/

  • to create drivers join SIG-OPS
  • to secure your system join SIG-SAC
  • If you have a knack for programming, there are many different groups for you to join. Those in interested in primarily internet and web techs (such as html, php, asp.net, j2ee, etc) should check out sigweb. If you're into emulation, hardware, or game programming, check out the NES Emulator Project. Finally, if you have a passion for Mac programming, SIG-MAC is your thing!

Linux Disctirbution

Search for help

  • When using google, this will help you a lot. Add:

faq configure install setup howto

Courtesy of ACM

 
unix_linux_information.txt · Last modified: 2008/10/03 16:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki