<<

(Solaris/) Quick Reference Card Logging In Commands the Login: prompt, enter your username. At the Password: prompt, enter Lists files in current directory your system password. Linux is case-sensitive, so enter upper and lower case ls -l Long listing of files letters as required for your username, password and commands. ls -a List all files, including hidden files ls -lat Long listing of all files sorted by last Exiting or Logging Out modification . ls wcp List all files matching the wildcard Enter logout and press or -D. pattern Changing your Password ls dn List files in the directory dn List files in tree Type at the command prompt. Type in your old password, then your new dn Change current directory to dn password, then re-enter your new password for verification. If the new password cd pub Changes to subdirectory “pub” is verified, your password will be changed. Many systems age passwords; this cd .. Changes to next higher level directory forces users to change their passwords at predetermined intervals. (previous directory) cd / Changes to the Changing your MS Network Password cd Changes to the users home directory cd /usr/xx Changes to the subdirectory “xx” in the Some servers maintain a second password exclusively for use with windows directory “usr” networking, allowing you to your home directory as a Network Drive. dn Makes a new directory named dn Type smbpasswd at the command prompt. Type in your old SMB passwword, dn Removes the directory dn (the then your new password, then re-enter your new password for verification. directory must be empty) Mounting your Home Directory under Windows Commands Right click My Computer or My Network Places and select Map Network Drive. fn Removes (deletes) the file named fn Your share name is of the form: \\servername\username : Example: \\mama\bob rm f1 f2 f3 Removes the files named f1,f2 & f3 rm *.o Deletes all files ending with .o Changing File Access rm -r dn Recursively deletes the directory dn and all files and directories in dn (BE CAREFUL!) sets file access privileges. chmod is followed by a person/action/ fn Displays the file named fn attribute flag then the file name. cat f1 f2 Concatenates and displays files f1 & f2 Person Action Attribute cat > fn Writes input from the keyboard into the a all + add r read file name fn. End input with Ctrl-D u user - remove fn Displays file fn, one page at a time. g group = absolute x execute space shows next screen. with “q” o others fn Like “more”, but “less” is better Examples: f1 f2 the file f1 to f2 chmod a+r fn Makes fn readable by everyone cp *. fn Copy files ending with .c into chmod a+x * Makes everything executable subdirectory dn chmod a-w fn Removes write access for fn cp /x/f1 . Copy file f1 in directory /x to current chmod ug+r fn Read access for user and group directory chmod u+x pro Makes the program pro executable f1 f2 Moves (renames) file f1 to f2 chmod a+rx dn Open the directory dn for access by everyone mv * .. Moves all files in the current directory to chmod og-rwx ~ Locks up home directory the previous directory. mv p/* x Moves all files in the directory p to the Text Editors directory x. JOVE Editor Editor jove fn Edits the file fn use the JOVE vi fn Edit the file fn using the VI editor I/O editor x Delete the character under the cursor > file Redirects output to file Ctrl-Z Saves file and quits JOVE Delete line : ls > output >> file Appends output to file Ctrl-C Quits JOVE without saving i Enter insert mode A Append to line ex: cat f1 >> f2 O Open new line and edit < file Takes input from file :w Writes file ex: < f1 > f2 :wq Write file and quit | Pipes output to next program UNIX :quit! Quits without saving changes ex: ls -la | less Wildcarding Internet Utilities * Matches zero or more of anything ssh addr Encrypted Remote login to another ? Matches any single character server with name addr (of the form [...] Matches any single character enclosed in [username@]hostname) braces scp fn addr: Upload file fn to remote server addr [^...] Matches any single character not enclosed scp addr:fn . Download file fn on server addr to in braces ~/ Expands to users home directory local directory rsync -av src dst Synchronize files at src and dst so ~username/ Expands to usernames’s home directory that they are the same. Use addr: Examples: *.[ch] Matches all files ending with .c or .h to specify remote machines. [A-Z]* Matches all files beginning with an ex: rsync -av /some/ bob@mama:dir uppercase letter ncftp addr File Transfer (FTP) to machine addr .* Matches all hidden files sftp addr Like FTP, but securely encrypted X*.o Matches all files beginning with X and links URL Text based WWW client for viewing ending with .o ~/x* Matches all files beginning with x in users web pages at URL home directory user a two way talk session with user talk user@hostname Start a remote two way talk session Compression and Archival Commands with user on the machine hostname gzip fn the file fn. Compressed files are renamed Additional Commands with a .gz exetension stty erase backspace Sets the backspace key to erase. gunzip fn.gz Uncompresses the file fn.gz. The Otherwise use delete. .gz extension is removed man cmd Online manual page for command cmd fn Better form of compression, files irc Internet Relay Chat (IRC) client renamed with .bz2 extension epic Another IRC client bunzip2 fn Restores files compressed with w Show is on and what they are bzip2 doing -cvf fn.tar dn Stores all the files in directory finger Show finger information for those dn into the file fn.tar can then be compressed online tar -cvf fn.tar f1 f2 f3... Stores the files f1, f2, f3, etc... finger user Show detailed finger information for into the file fn.tar the user user tar -xvf fn.tar Extracts the files from fn.tar chfn Change your finger information tar -tf fn.tar Lists all the files in fn.tar date Show the date and time Print a calendar to the screen FTP Commands -s dn Show disk usage used in directory open hostname Starts an FTP connection to dn hostname fn check the file fn interactively cd dn Change directory to the directory user < mesg Mail to the user user the contents of named dn the file lcd dn Sets local directory (where files are put and got from) pine A graphical terminal based mail ls Short listing of files in directory program dir Long listing of files in directory mutt Like pine, but better. binary Sets binary transfer mode fn Sort the lines in the file fn Sets ascii transfer mode List all processes you have running get fn Gets the file fn from the remote -9 PID Kill the process with the process machine to the local machine number PID put fn Puts the file fn from the local machine short command Creates an alias for command to the remote machine called short. To the alias !cmd Executes the UNIX command cmd permanent, place the alias in your quit Ends the FTP session and exits .cshrc file. ex: alias f finger