Technology Support Center

Using the Korn Shell (ksh) on BGResearch


The following table describes some common Unix commands and features of the Korn (ksh) used on bgresearch.

Command or featureksh (on bgresearch)
Commands executed when logging in


Commands executed with each process.kshrc
Display the contents of a file on the screencat
Return to the login directorycd
Change default directory to directory-namecd directory-name
Clear the terminal screenclear
Copy file source to destcp source dest
Interrupt the execution of the current program[Control]-c
Log off the systemexit or [Control]-d
List files waiting to be printedlpq
Send a file to the printercslpr filename
Lists the files in the current directoryls
Lists the files in the current directory, with more -l
Create a subdirectory called dir-namemkdir dir-name
Display information about a unix commandman command
View a file one page at a timemore filename
Rename a filemv old-name new-name
Change your passwordpasswd
Save a session in a photo filephoto log-file-name
Create or edit a filevi filename or
pico filename
Display the current default directorypwd
Delete (remove) a filerm filename
Delete (remove) an empty directoryrmdir dirname
Redirect standard output to a filecommand > file
Redirect standard output and errors to a filecommand > file 2>&1
Create an aliasalias m='more'
Remove an aliasunalias m
List command historyhistory
Reexecute the previous commandr
Reexecute the previous command changing ab to xyr ab=xy
Reexecute the fifth command in the history listr 5
Reexecute the last command that started with vir vi
Define a function

function fun {

Execute a functionfun
Delete a functionunset -f fun
Represents home directory of current user~
Represents home directory of user jsmith~jsmith
Represents current working directory. (period) or ~+
Represents previous working directory~-
Compile a C++ programg++ prog.cpp
Compile a C++ program for use with debuggerg++ -g prog.cpp
Complete a partial filenamePress [Esc] then \

To set your bgunix prompt to be the current working directory, add the following line to $HOME/.profile : export PS1='$PWD>'