Berkeley CSUA MOTD:Entry 26243
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2002/10/18 [Computer/SW/Unix] UID:26243 Activity:high
10.17   anyone have a good unix primer (online) for college freshman? my
        little brother knows ls, pine, pico, who, and talk, but that's about
        it. something that can introduce him to the concept of jobs, processes,
        pipes, but also, simpler stuff, like... i dont know, the stuff that
        the average unix user takes for granted.
        \_ Unix for the Impatient
        \_ dont let him use pine.
        \_ go take a community college class on Linux certification,
           that would help.  Or take a class on web page thingy
           (make sure it's shell script + CGI  instead of Frontpage + IIS).
           That will get him started. The rest of it is just force
           oneself uses an unix-like machine (e.g. linux) at home, and
           not afrad of asking questions without be flamed.  Unix crowd
           love to flame newbies, but I have found that Unix crowd
           is tend to be much more helpful than let say, VB crowd...
           they usually teach you how to do things after they laughed
           at you for being such stupid ass.     --still an unix newbie
           \_ That's cuz VB is black magic...and stupid black magic.
                 taking away their job after read a "... in 24 hours" book,
              \_ No, it's because the VBers have an honest fear of some newbie
                 taking away their job after reading a "... in 24 hours" book,
                 but the unix people are just low-social-skills pricks who
                 really want to help but not until after they've lorded it
                 over someone for a bit.
                 \_ Indeed!!
        \_ I wrote an introduction to unix for 61a students a few years ago.
           http://www.csua.berkeley.edu/~twohey/using_unix.html
           Most of the material should still be current. Corrections /
           suggestions for improvement welcome. --twohey
ERROR, url_link recursive (eces.Colorado.EDU/secure/mindterm2) 2024/11/23 [General] UID:1000 Activity:popular
11/23   

You may also be interested in these entries...
2012/8/26-11/7 [Computer/SW/Security] UID:54465 Activity:nil
8/26    Poll: how many of you pub/priv key users: 1) use private keys that
        are not password protected 2) password protect your private keys
        but don't use ssh-agent 3) use ssh-agent:
        1) .
        2) ..
        3) ...
	...
2012/8/29-11/7 [Computer/SW/Security] UID:54467 Activity:nil
8/29    There was once a CSUA web page which runs an SSH client for logging
        on to soda.  Does that page still exist?  Can someone remind me of the
        URL please?  Thx.
        \_ what do you mean? instruction on how to ssh into soda?
           \_ No I think he means the ssh applet, which, iirc, was an applet
              that implemented an ssh v1 client.  I think this page went away
	...
2012/9/20-11/7 [Computer/SW/Unix, Finance/Investment] UID:54482 Activity:nil
9/20    How do I change my shell? chsh says "Cannot change ID to root."
        \_ /usr/bin/chsh does not have the SUID permission set. Without
           being set, it does not successfully change a user's shell.
           Typical newbie sys admin (on soda)
           \_ Actually, it does: -rwsr-xr-x 1 root root 37552 Feb 15  2011 /usr/bin/chsh
	...
2012/9/24-11/7 [Computer/SW/Languages, Computer/SW/Unix] UID:54484 Activity:nil
9/24    How come changing my shell using ldapmodify (chsh doesn't work) doesn't
        work either? ldapsearch and getent show the new shell but I still get
        the old shell on login.
        \_ Scratch that, it magically took my new shell now. WTF?
           \_ probably nscd(8)
	...
2012/3/29-6/4 [Computer/HW/Memory, Computer/HW/CPU, Computer/HW/Drives] UID:54351 Activity:nil
3/29    A friend wants a PC (no mac). She doesn't want Dell. Is there a
        good place that can custom build for you (SSD, large RAM, cheap video
        card--no game)?
        \_ As a side note: back in my Cal days more than two decades ago when
           having a 387SX made me the only person with floating-point hardware,
           most machines were custom built.
	...
2012/4/27-6/4 [Computer/SW/Languages/Misc, Computer/SW/Unix] UID:54372 Activity:nil
4/27    I wrote a little shell script to collect iostat data:
        #!/bin/bash
        DATE=`date +%m%d`
        DATADIR=/var/tmp/user
        OUTPUTFILE=$DATADIR/$DATE.out
        while true
	...
2012/1/27-3/26 [Computer/SW/Unix] UID:54299 Activity:nil
1/27    Interesting list of useful unix tools. Shout out to
        cowsay even!
        http://www.stumbleupon.com/su/3428AB/kkovacs.eu/cool-but-obscure-unix-tools
        \_ This is nice.  Thanks.
	...
2011/10/26-12/6 [Computer/SW/Unix] UID:54202 Activity:nil
10/24  What's an easy way to see if say column 3 of a file matches a list of
       expressions in a file? Basically I want to combine "grep -f <file>"
       to store the patterns and awk's $3 ~ /(AAA|BBB|CCC)/ ... I realize
       I can do this with "egrep -f " and use regexp instead of strings, but
       was wondering if there was some magic way to do this.
       \_ UNIX has no magic. Make a shell script to produce the ask or egrep
	...
2011/4/27-7/30 [Computer/SW/Security, Computer/SW/Unix] UID:54096 Activity:nil
4/28    Will wall be fixed?   - jsl
        \_ What's wall?
           \_ An anachronism from a bygone era, when computers were hard to
              comeby, the dorms didn't have net, there was no airbears, and
              when phones didn't come standard with twitter or sms.
           \_ A non useful implementation of twitter.
	...
2011/5/19-7/30 [Computer/SW/Security] UID:54110 Activity:nil
5/19    Uh, is anyone still using this? Please mark here if you post and
        haven't added this yet. I'll start:
        \_ person k
        \_ ausman, I check in about once a week.
        \_ erikred, twice a week or so.
        \_ mehlhaff, I login when I actually own my home directory instead of
	...
Cache (8192 bytes)
www.csua.berkeley.edu/~twohey/using_unix.html
The Labs and Your Account On the first day of class you should have been given an account form. If you forget your login name while you are logged in, you can find it by typing: % whoami at the shell prompt. Note that you are not supposed to type the %, it is the shell prompt. Shells and Terminals The UNIX shell is a command line interface similar to DOS, but much more powerful. The UNIX shell is difficult to learn, but once mastered can be made to do almost anything. There are several different UNIX shells, but they all share a similar interface. When you want more than one shell running, launch a new terminal by typing: % xterm & One of the most important tasks the shell performs is launching programs. To launch a program, type its name at the shell prompt, followed by the arguments to the program and then hit enter. To do this you need to go to your log in shell and type: % logout The log in shell is the window named shell . If you have minimized your log in shell it will be a white rectangular box with the word shell in the middle. Emacs and Scheme emacs is a thermonuclear text editor, a program with unlimited potential. Most of the commonly used emacs features are control sequences (C-x) , while the less commonly used features are meta sequences (M-x). C-x is the standard notation for control sequences, it is obtained by pressing the control key and then the x key. On the HP and Solaris computers M-x is obtained by pressing the alt and x keys at the same time. To start the scm scheme interpreter, withing emacs type M-x run-scheme . You will notice that after you type M-x, the text cursor has moved to a separate area at the bottom of the emacs window. This area is called the Mini-Window and is where emacs expects text input for its commands. You can always hit (C-g) to quit out of the Mini-Buffer if you make a mistake. To quit scm, either kill the buffer it is contained in, or type (quit) at the scheme prompt. To open an already existing file, go to the File menu and select Open File (C-x f) and type the name of the file and hit enter. To create a new file, go to the File menu and select Open File (C-x f) and type the name for the new file want the file and hit enter. This can be confusing because creating a new file and opening an existing file use the same interface. To save a file, make sure the cursor is active in a window that is editing the file and select Save Buffer (C-x s) from the File menu. When emacs prompts you if you want to save changes to the buffer, type y and hit enter. To save all open files, use the keyboard shortcut (C-x C-s) . When emacs prompts you if you want to save changes to a particular file, type y and hit enter. If you have more open files than windows, you can select which file you want to view in a window by clicking in the window and then selecting the appropriate file from the Buffers menu. You can switch between buffers in this mode by moving the cursor over the buffer and pressing enter or clicking the mouse. To close a file, select Kill Buffer (C-x k) from the File menu. To quit emacs select Exit Emacs (C-x C-c) from the File menu. When you are in the Mini-Window and have type part of a long meta command or file name, emacs will guess which command you want if you hit the tab key. To split the emacs window with the cursor in it horizontally, select Split Window (C-x 2) from the File menu. To split the emacs window with the cursor in it vertically use the keyboard shortcut (C-x 3). To switch between open windows click in the window you want to make active or use the keyboard shortcut (C-x o). To collapse all the emacs windows into one window, select One Window (C-x 1) from the File menu. Unix Copy and Paste To copy text, hold down the middle mouse button and select the desired text. To paste text, click the middle mouse button where you want the copied text to start. This form of copy and paste works across most UNIX applications. Caveat: Extremely large blocks of text being copied or pasted with the mouse may lose some data. Files and Directories The UNIX file system is organized around files and directories. Your home directory is where you should save your files. Your home directory has a two special names: $HOME and . Forward slashes are used to delineate directories in a path. Files are case sensitive, BOX and box are two different file names. You can specify more than one file with a path by using wild cards. The * wild card matches any number of characters, while the ? When you are working within the shell, it keeps track of the directory you are using. This directory is called the current working directory, or the current directory. To create a new directory named foo, type: % mkdir foo To create a copy of a file foo called bar, type: % cp foo bar To move file bar into directory foo, type: % mv bar foo To remove a file foo, type: % rm foo To remove a directory you must first ensure that the directory does not contain any other files or directories, then type: % rmdir directory When you remove or delete something on a UNIX system it is gone forever. There is no way to recover deleted files, so be careful. To prevent the servers from running out of disk space, your accounts are only allowed to store a limited amount of data. To find out how much room you have left, type: % quota Printing All the printing commands will print to the printer nearest the computer you are logged into unless you tell them otherwise. All the instructional printers in Soda Hall are named after the room they are in. The printer in 330 Soda Hall is called lw330, while the downstairs printer in 274 is called lw274. After you have issued a print command, your print job is put into a queue and printed when all the print jobs before it are done printing. Near homework and project deadlines the queue is often large (over 100 print jobs), so be prepared and print early. When you login to a computer, the default printer is the print to which your print jobs will go if you do not specify another printer. The default printer is usually the printer the is closest to the computer to which you are logged in. Do not ever use enscript on anything other than a text file, it will make the printer spew out random stuff for thirty minuets and it will make everyone behind you in the print queue very angry. Remote Access One of the strengths of the UNIX operating system is that it works well over a network. You can use a Solaris machine in Australia to login to a HPUX computer in Tokyo and use the programs on the HP machine, without having have them on your computer. The best way to log into a remote computer from another UNIX computer is to use the ssh command. It uses strong encryption and is secure against most attacks. You may have heard of other programs like rlogin and telnet. These are insecure, do not use them, it is too easy for a hacker to intercept your password and steal your account. To login to a remote computer named dilbert, type: % ssh dilbert If you have never logged into dilbert before ssh will ask you if you really trust dilbert, you should answer yes . If you want to login to the CS computing facilities from home and use graphical applications you will need X Windows software. The department provides FSecure for Mac OS, but unless you have an X Server for Mac OS, Nifty Telnet is the better choice. Processes Every time you launch a program, it is given a process id number (PID), this number distinguishes this process from all other running process. To list all the process you have launched from a shell, type: % ps To list all the process you are running on the computer on which a shell is running on, type: % ps -u your-login Occasionally a program crashes or refuses to quit, if this happens you can kill it. To kill a process, type: % kill PID If the kill command didn't kill the process, try again. If the process is still alive, type: % kill -9 PID Be careful when you use kill -9 , it is very powerful and should be used with extreme caution. Web and Email The only decent web browser on UNIX is Netscape Communicator, launch it by typing: % netscape & Netscape Communicator is a good web browser, but it is overkill for...