<<

Content borrowed and updated (with permission) for Newbies from Duane A. Bailey’s guidelines from 2007.

Getting on unix: Some Tips To Your UNIX Life Reasonable man !!Get full description of command man -k !! ! List command mentioning keyword in 0. Walk away from the machine. If you’re not making progress, don’t waste banging your (literally or Logging in and out of a system: figuratively) against the machine. Save your files, the buggy output, or logout!!!!Terminate session create a backup and walk away. someone to to about something else. Your !!!!Terminate current “shell” mind will work on the problem while you go get a snack and take a break. ssh @!Login securely as username to remote 1. Read man pages. Manipulation: Realize that you don’t know everything. Take the time to learn how man pages are emacs !!!Edit a text file (See the emacs cheatsheet) structured and what they can teach you. You find answers to many questions on the !!! or rename file as file internet, but you learn even more by finding and reading the man pages. Better, !!!Delete file(s) from filesystem you learn elegant solutions to questions you didn’t think to ask. !! to file named sftp !!Secure batch file transfers between machines 2. Learn the emacs keystrokes. scp host: host:!Securely transfer files between machines It will save you time when you work on a machine whose mouse or arrow keys aren’t !!!Display or catenate file contents to screen working, and the keystrokes often work in other editors. Many cursor more !!!Display file page by page (but: use ) manipulations from emacs are based on from the bash shell: less !!!Display file page by page (use this one) !^P = previous command head !!!Display the first few lines of a file !^N = next command !!!Display the last few lines of a file !^R = search for command from the past by typing a few letters !!Search for pattern within file !^A = go to the beginning of the command line source !!!reach commands from file !^E = go to the end of the command line !^B = go back one character manipulation: !^F = go forward one character !!!Goto Directory (change focus to files in

) !^D = delete this character !!!!List files in current directory ! = delete previous character !!!!Print working directory (where am I?) !!!Make a new subdirectory (in this one) with Name 3. Learn about your environment. !!!Remove an (empty) subdirectory Shells have survived the of time by helping their users do powerful and complex tasks. You want to learn more about ‘aliases’ and ‘shell scripts’. Printing and : Brownie points for learning about: find, , gawk, perl, rsync firefox !!!Open browser (under X11) url acroread !!Open a “.pdf” file in acrobat reader 4. Stay organized. gs !!Open a “.” file with the ghostscript reader Create directories to organize your files within the home directory. Organize by lynx!!!!Text-only (fast!) browser some sane method and delete temporary files that pile up and confuse matters.

C Compilation and Debugging: 5. Make backups, use version control gcc !!!Compile C program into “a.out” executable We all screw up sometime, usually at 3am the night before the deadline. Use gcc -o !Compile C program into executable version control systems (cvs, svn, git, mercurial...) to keep a revision history gcc -g -c !!Compile C program into debuggable file you can roll back to. In a pinch, just copy the file and save it when you’re gcc -o ! object files (f and g) into single exec making large changes. Your sleeping habits will thank you. gcc - -o !Compile and link file with all warnings enabled gcc -std-gnu99 -o !Compile and link file under 1999 standards 6. Work with others. gdb !! ! Run executable under debugging control Working with others (usually in a lab) lets you get help when you need it and gdb !!Resurrect coredump with executable as model learn about how others are doing the work. When the whole lab is suffering through the same project, it makes your night that much easier. And it makes home Information about Users and Systems: a more pleasant place to return to. !!!!’s on the system !!!!What the top cpu processes 7. Practice. ps!!!!List processes on this system Practice more than you think you need. You know why. !!!!Who is logged in at this window finger !!!Get details on user 8. . last !!!List last time users used this machine Good writing is hard, and many computer scientists don’t write enough to write !!!!Print stats on machine well. with comments on your code, work on documentation for large projects, and learn how to write prose with ease. Key Websites: 9. Tell others what you’re working on. http://www.cs.washington.edu!!!CS homepage You learn how much you know (and how much you don’t) when you try and explain http://homes.cs.washington.edu/~!Your homepage your work to others. Working on computer science is only good so far as you can

share it with others. /cse/web/homes/!!!!Where your web files live