G. Levine BRIEF INTRODUCTION TO UNIX (Windows equivalent given inside {} ) Most of these are part of the POSIX standard, but not all. alpha> SYSTEM PROMPT. UNIX IS cASe SeNSiTiVE!!!!!! If the backspace and delete do not work, use ctrl+ backspace. man {HELP -- use it!!} man | more to prevent screen scrolling {in Windows command mode help/? | more provides help on help} cd / TAKES YOU TO ROOT (Note the front slash rather than \) {in Windows Explorer, click onto C:\ assuming that you want the root of the C drive} cd ~ TAKES YOU TO YOUR HOME DIRECTORY (where you log in) The Alpha's file system is hierarchical; student accounts are under /home/class/ pwd LETS YOU KNOW WHERE YOU ARE LOCATED IN THE DIRECTORY {in windows command mode, the full path is displayed by the command interpreter} mkdir CREATES DIRECTORY {Windows Explorer - File/new/folder } rmdir REMOVES directory IF ITS EMPTY {Windows Explorer/delete the chosen folder} cd CHANGES CURRENT DIRECTORY cd .. MOVE UP ONE LEVEL IN THE DIRECTORY HIERARCHY; note the required sapce after cd and before .. mv file1 file2 RENAME {Explorer- File/rename} mv file1 MOVES FILE INTO SPECIFIED DIRECTORY {Drag file/subdirectory to other location} cp file1 file2 COPY FILE1 TO FILE2 makes a new copy of the file; overwrite file2 if it already existed {Explorer - save with another file name} rm file1 SHIFT DELETE del file1 in command mode- THERE IS NO WARNING MESSAGE ls LIST FILES IN CURRENT DIRECTORY {in Windows command mode, same as dir command} (WORKS WITH * AS IN COMMAND MODE, FOR EXAMPLE, ls *.c) ls ~/levine/Mail LISTS TWO-LEVEL SUBDIRECTORY levine/Mail's FILES ls -l SWITCH FOR STATISTICS ON ACCESS RIGHTS, ETC. ls -lt COMBINED SWITCHES TO ORDER FILES BY TIME, as well as above ls -a LIST HIDDEN FILES (preceded with .) & REGULAR ONES cat file1 SCROLLS FILE ON SCREEN {You can use this on Windows if it is a text file type file1} USED WITH REDIRECTION OPERATOR cat unix > myunix COPIES THE FILE unix to myunix; replaces myunix if it exists. cat unix >> myunix APPENDS THE FILE unix to myunix more file1 SCROLLS A PAGE AT A TIME ON SCREEN man file2 REDIRECTS OUTPUT TO FILE2 cat file1 >> file2 APPENDS FILE1 AT THE END OF FILE2 cat file1 | lpr PIPES OUTPUT TO PRINTER PROCESS Redirection sends output to a file; pipes send output to a process for processing date who LISTS USERS ON SYSTEM {available on NT, not 98} who am i THAT'S YOU wc LISTS # OF LINES,WORDS,CHARACTERS CONTROL C TO INTERRUPT CONTROL Z TO SUSPEND fg TO RECOVER FROM STOPPED JOBS (MOVE TO FOREGROUND) logout TO LOGOUT ps LISTS YOUR CURRENT (INCLUDING SUSPENDED) PROCESSES {control alt del/ task list in Windows GUI} {tasklist in Windows command mode} jobs LISTS YOUR JOBS kill -9 PID (%#) PID (#) IS OBTAINED FROM COMMANDS ABOVE (or just kill PID) (Sometimes kill does not kill a process; kill -9 kills unconditionally) {click right top x of window} {taskkill /PID # in command mode} sort file1 | wc | sort > file2 WILL SORT file1's LINES, COMPUTE ITS WORD COUNT, SORT THE RESULT AND PLACE THAT IN FILE2 grep "pattern" file1 SEARCH FOR pattern IN file1 grep -n levine * SEARCH FOR LINE NUMBER OF levine IN ALL FILES IN CURRENT DIRECTORY grep -i "kill -9" unix SEARCH WITH CASE INSENSITIVITY FOR THE STRING kill -9 IN THE FILE unix vquota LIST OF YOUR DISK SPACE AND FILE QUOTA chmod octal, octal, octal changes protection rights 1st octal number for owner 2nd octal number for group 3rd octal number for world octal number 1 - execute only (for directories, executable files) octal number 2 - write only octal number 4 - read only octal number 5 - read, execute octal number 6 - read, write octal number 7 - read, write, execute chmod 644 for your web pages (110100100 or rw_r__r__) chmod 711 for your web directories (111001001 or rwx__x__x) find . -name FILENAME -print prints out locations of filename anywhere in your directory {dir/s in DOS; search in Windows} history > FILENAME stores the commands that you previously executed on the terminal into a file. you can then print out the file. Does not work on all shells ln -s . Makes a symbolic link between the source directory (assuming correct access rights) and the current directory- You'll see source directory listed in current directory du displays disk use in blocks echo $PATH Unix has an intialization file that sets parameters each time a user logs in- This file may be called .profile. If you can change this file, you can assign directory paths that the system will search for any file name you enter in each of those paths (in order) {In DOS this was accomplished in autoexec.bat)} cat /etc/passwd Try this to see what is displayed w Current system activity {some of the functionality of task manager} Linux environment: top for system metrics.