University of North Texas Computing and Information Technology Center
Computing and Information Technology Center Home
Help Desk
Training
About Us
Publications
Our Mission

 



Some Useful UNIX Commands

Entering Commands

Once you have successfully logged onto Sol, you will see the ~% prompt.  Please note UNIX is case sensitive, and all commands must be entered in the specified case.  To enter a command, type the command then press <Enter>.  Below is a list of the most commonly used commands on Sol.

ls , lm or dir
Lists contents of current directory *

pico or edit filename
Edit a file called "filename"

cp file1 file2
Make a copy of "file1" called "file2"

mv file1 file 2
Rename "file1" as "file2"

rm filename
Delete a file called "filename"

rmdir filename
Delete a directory called "filename"

mkdir newdir
Create a new subdirectory called "newdir"

cd newdir
Go to another directory called "newdir"

pwd
Returns the name of the current directory

less filename
Browse through a file called "filename"
Press f to go forward; b to go backward; and q to quit.

gzip filename & gunzip filename.gz
Compress or uncompress a file to conserve disk space

help
Prints the most commonly ask questions

* A Directory Listing of Your Files. 
 
To list the files in your account, the basic command is ls.  By adding options to the ls command, it is possible to obtain more information about the file, such as the date it was created and the size of the file in bytes.  The most commonly used options used with ls are the -l and the -a options.  The -l option lists the owner of the files, the group they belong to, their size in bytes, and the date last modified.  The command dir is an alias for the ls -lL command.  The command lm, an alias for the ls - CF command shows symbolic links with a trailing @ symbol, and directories with a trailing /.  The -a option lists "hidden" files that are not normally listed ("hidden" files have a "." as the first character in the filename).  You can do the following the see exactly what is in your account:

                                    ~ % cd
                                    ~ % dir -aR | more


Temporary short-term storage space (SOL)

Sol has an area that may be used by any user on the system without special permission.  This area is called the "scratch" area.  Please keep in mind that this area is for temporary storage only, and that files may be deleted by the system without notice.  Files may be kept on the scratch area for seven days before they are deleted by the system.  To use the scratch partition,

1.  Go into the scratch directoty.
 
      ~ % cd /scratch

2.  Make a subdirectory in the scratch area for yourself The name of your    
     subdirectory should be your User-ID.  The files you keep in this
     subdirectory will be accessible only by yourself. As an example, if your
     User-ID is "uid1234", you would type

     ~ % mkdir uid1234  

3.  Now you may either go into your scratch subdirectory and use it as a
     temporary work space, or copy files into it from some other directory on
     the system.  To go into your scratch subdirectory from anywhere on the
     system, type
 
      ~ % cd / scratch / uid1234


Downloading Files from Sol to Your Home Computer (WinSCP)

WinSCP is a freeware SCP client for Windows 95/98/ME/NT/2000/XP using SSH (Secure SHell).  Its main function is safe copying of files between a local and a remote computer.

The WinSCP program is free and can be downloaded, here.  Double click on this WinSCP icon on your desktop once it is downloaded and installed.  Alternatively, you can run WinSCP by running "winscp310" from the
'START' --> 'RUN' menu.

WinSCP Documentation

Hints and Shortcuts

  • A command that was previously entered can be recalled by pressing the <Up-arrow> key.
     
  • A process may be suspended temporarily by pressing the key sequence <Ctrl-Z>, and resumed
    by typing the command fg at the prompt.
     
  • The key sequence <Ctrl-L> may be used to redraw the screen.
     
  • It is often possible to exit a runaway program by using the key sequence <Ctrl-C>.

 


Computing and Information Technology Center Home | Help Desk | Training
About Us | Publications | Our Mission

Questions, comments and corrections for this site: helpdesk@unt.edu
Site was last updated or revised : January 8, 2004

UNT home page | Search UNT | UNT news | UNT events