Unix Quickref.Dvi
Total Page:16
File Type:pdf, Size:1020Kb
Summary of UNIX commands Table of Contents df [dirname] display free disk space. If dirname is omitted, 1. Directory and file commands 1994,1995,1996 Budi Rahardjo ([email protected]) display all available disks. The output maybe This is a summary of UNIX commands available 2. Print-related commands in blocks or in Kbytes. Use df -k in Solaris. on most UNIX systems. Depending on the config- uration, some of the commands may be unavailable 3. Miscellaneous commands du [dirname] on your site. These commands may be a commer- display disk usage. cial program, freeware or public domain program that 4. Process management must be installed separately, or probably just not in less filename your search path. Check your local documentation or 5. File archive and compression display filename one screenful. A pager similar manual pages for more details (e.g. man program- to (better than) more. 6. Text editors name). This reference card, obviously, cannot de- ls [dirname] scribe all UNIX commands in details, but instead I 7. Mail programs picked commands that are useful and interesting from list the content of directory dirname. Options: a user's point of view. 8. Usnet news -a display hidden files, -l display in long format 9. File transfer and remote access mkdir dirname Disclaimer make directory dirname The author makes no warranty of any kind, expressed 10. X window or implied, including the warranties of merchantabil- more filename 11. Graph, Plot, Image processing tools ity or fitness for a particular purpose, with regard to view file filename one screenfull at a time the use of commands contained in this reference card. 12. Information systems mv oldname newname This reference card is provided "as is". The author rename file oldname to file newname. If new- shall not be liable for damage in connection with, or 13. Networking programs name is a directory, then move oldname into arising out of the furnishing, performance, or the use directory newname. of these commands or the associated descriptions. 14. Programming tools 15. Text processors, typesetters, and previewers pg filename Conventions view filename one screenfull at a time (a pager). 16. Spreadsheets bold pwd represents program name 1. Directory and file commands print working directory dirname represents directory name as an argument cat filename rmdir dirname display the content of file filename remove directory dirname (if dirname is empty). filename represents file name as an argument cd [dirname] rm file1 [file2 ...] change directory to dirname. If dirname is omit- remove files file1, file2, etc. [dirname] ted, change to your home directory. optional directory name (or other optional ar- rm -r dirname gument) as argument. If it is not given, the cp source destination remove dirname recursively, removing all files current directory will be used. copy file source into file destination. and subdirectories underneath dirname. 1 2. Print-related commands which commandname tar show the location of commandname combine files into one tar file, or extract files lpq [-Pprintername] from a tar file. A tar file could be a device who query printer queue of the default printer. If (magnetic tape as /dev/rst0) or a plain file. To who is on-line on this machine printername is given, will query printer printer- extract filename.tar name. tar xvf filename.tar 4. Process management To combine all files under dirname into file- lpr [-Pprintername] filename name.tar: print filename (send filename to the default kill SIGNUM PID tar cvf filename.tar dirname printer). If printername is given, will send to Send signal SIGNUM to process ID PID, or filename to printername. kill (terminate) process with process ID num- ber PID. For example: lprm [-Pprintername] jobnum uncompress filename.Z remove printing job number jubnum from kill -HUP 5555 expand filename.Z into its original size and re- printer printername. nice programname move the .Z extension run program programname with lower priority lpstat (nicer to other users). Recommended for run- check printer status (HP-UX, Solaris 2.x) ning background processes. ps unarj filename.arj 3. Miscellaneous commands check processes. The options for this command exteract files from an ARJ archive env depends on the version and variation of your print or alter environment variables hostname UNIX. Check your local documentation. display host name top unzip filename.zip show (continuously) what process(es) is run- extract files from filename.zip. The reverse of man topic ning. zip command. display on-line manual on topic. screen 5. File archive and compression create multiple screen with one physical screen. compress filename zip zipname files This program is useful if you have a text- make filename smaller (compression). filename create an archive file (and compress it) called only (e.g. vt100) terminal. Move around with will be replaced by filename.Z ( a .Z extension zipname.zip which contains files. control-A. is added). uname gunzip filename.gz print system name expand filename.gz into its original form (size) MTOOLS and remove the .gz extension. This is GNU un- There is a set of commands to access MS-DOS users zip. display all users on-line disks on systems equipped with floppy disk. gzip filename Most DOS file commands are available (prefixed w compress filename with GNU zip (gzip) and add with 'm'): check who is doing what .gz extension mcopy, mdel, mdir, mmd, mtype, etc. 2 6. Text editors 7. Mail Programs scan scan mailbox/folder asWedit [filename] biff HTML editor notify new mail has arrived show show current selected e-mail. axe [filename] elm read and/or compose e-mail. a simple X window text editor 8. Usenet news exmh elvis [filename] X windows mail reader based on MH, see below knews a vi clone interactive X window-based news reader fastmail emacs [filename] quick batch mail (part of Elm) nn start emacs. A more extensive documentation read news with nn (NoNews is good news.) Can is available on-line. Reference card for GNU from be used to read through NNTP or spool. emacs is also available from FSF GNU emacs list senders of mails in your mailbox nntidy distribution. frm [foldername] cleanup or tidy your .newsrc similar to from but has a better output. If gvim [filename] foldername is present, it will list senders in rn X11 gui version of vim folder foldername instead your incoming mail- read news with rn. box. This program is distributed as part of the jed [filename] trn elm package. jed text editor threaded rn newsreader mail [userid] xrn joe [filename] read mail. If userid is given in the command a WordStar-like editor line, it will be used in compose mode. After X window-based news reader done, mail will be sent to userid nedit [filename] 9. File transfer and remote access a Motif-based text editor mailtool OpenWindows mail program bftp textedit [filename] OpenWindows text editor batch FTP mush vi [filename] mail user shell. Similar to ftp hostname vi editor Using the ftp prgram to perform FTP to/from mail , but has a better user interface. host hostname. vim [filename] MH package a vi-clone ftptool There are also other e-mail packages, such as X-window (xview) based FTP prgram MH, which come with their own commands. For xedit [filename] example, MH has the following commands (and kermit a simple X window text editor more): send or receive files with kermit protocol. xemacs [filename] inc kermit -sfilename X window Emacs (formerly Lucid Emacs) incorporate mail into inbox folder. to send filename 3 kermit -rfilename mwm ghostview or gv to receive filename Motif window manager a front-end of ghostscript ( gs). minicom olvwm giftrans communication package similar to Procomm OpenLook virtual window manager converts GIF image to transparant GIF. olwm ncftp hostname gimp OpenLook window manager a user-friendly FTP program image processing tool/drawing program with fil- twm ters (plug-ins) to manipulate image. rlogin hostname [-l userid] tab window manager remote login to host hostname. If -l userid is gnuplot given, will login as userid X window programs a freeware plotting program capable of plotting 2D and 3D plots. It supports a wide variety of rsh hostname filemgr output formats. remote shell to host hostname OpenWindows file manager gs ssh [-l login name] hostname [command] xcalc Ghostscript, a PostScript previewer. It can also connect to hostname with ssh (secure shell). If calculator no command is given a shell will be started on be used to convert PostScript into other graphic formats. host hostname. This is similar to telnet but the xclock communication will be encrypted. display clock ps2epsifile.ps [file.epsi] telnet hostname [portnum] create Adobe's Encapsulated PostScript Inter- xfm change (EPSI) format from a postscript file. connect to hostname with telnet. If portnum file managerX is specified, connect to port portnum. (Usually psselect infile [outfile] portnum is required if you want to connect to xlock select pages from a PostScript file. various services such as IRC or MUD.) lock your screen pstoedit xftp xman converts PostScript to tgif format for editing X-window interface to FTP view/search manual pages rplot xrsh hostname xterm plot 2-D data Open remote shell on host hostname in a new a terminal or shell session xterm window. tgif an X window drawing tool. It can produce var- 10. X windows 11. Graph, Plot, and Image Process- ious output formats, including PostScript. ing Tools Window manager One of the following programs xfig (window managers) is usually started when you coreldraw an X window drawing tool capable of producing login on a Unix workstation, the actual choice start CorelDraw (commercial drawing program) fig output is controlled by your .xsession or .xinitrc file. corelpaint xgraph fvwm2 start Corel Paint program (a commercial paint- a simple X window graphing program able to feeble window manager ing program) produce a bar graph.