Some Unix Commands

 

 

1.       To see all files in the current directory including a script file, type:
ls                                                <return>

2.       To see contents of a file (e.g., lab01_scriptfile), type:
cat    lab01_scriptfile                   <return>           or
more  lab01_scriptfile                 <return>

3.       To send a file like your script file lab01_scriptfile (which is currently on the cs.uwindsor.ca) to your home computer so that you can print it, you need to use ssh secure ftp program to transfer files from one computer to another. To use ssh ftp, follow the steps below:

a.    From your home computer, open the ssh shell file transfer program (which you must have downloaded from www.uwindsor.ca/its/downloads).

b.  Now, quick connect to cs.uwindsor.ca with your username and password.

c.          Now, you have the files on your davinci account on the right window.  Click on the file you want to download (that is, copy to your local PC), then, click on operations menu, and select download dialog.  It opens up the files and folders on your PC.  Select the folder on your PC you want to download this file to (Eg., folder 60-140).
[This will place this file in your home PC in the directory C:\60-140 ]

d.          You can now disconnect from ssh secure shell file transfer and exit the window.

e.           Now, you can use your Notepad or Wordpad to simply print the file lab01_scriptfile from directory C:\60-140.

4.      Other commands include ssh for connecting to a remote Unix computer (like cs.uwindsor.ca) so that you can use the programs in the remote computer.  For example, you can connect to cs.uwindsor.ca from your home PC using ssh client as described in (iii) above except that you want to open the ssh secure shell window (not the ssh secure file transfer window).

a     Logon to cs.uwindsor.ca with your user id and password when prompted.

c.    You can now use any Unix commands on server for listing your files, compiling your C programs and running your C programs as well as editing your C programs (note though that only non-window based text editors like pico or vi can be used when you connect to the server remotely through a PC).

 The secure shell client (ssh) and secure shell file transfer commands are not available on  all operating systems, but can be downloaded.  Only these secure versions of telnet and ftp programs for connecting to a server and transferring files to/from a server are allowed for remote access to davinci server.

 

5.      To create a new directory on Unix, use the mkdir command as:
mkdir    dirname                                   <return>

6.      To change to a different directory on Unix, use the cd  as:
cd               dirname                             <return>
[Note that dirname stands for the entire path of the directory from root  (/)or home directory (~)]

7.      To move up one directory, for example to the parent directory, use:
cd   ..                                                               <return>

8.      Whereever you are, to go to your home directory, use:
cd    ~                                                              <return>

9.      To make a copy of lab01.c file and keep in lab01cp.c, use:
cp  lab01.c   lab01cp.c             <return>

10.  To delete a file like delete lab01.c after making a copy, use:
rm   lab01.c                                          <return>

11.  To rename a file from lab01.c  to lab02.c, use:
mv   lab01.c   lab02.c               <return>

12.  To compile a C program (in file.c), use:

cc  file.c                           <return>

13.                     To execute a compiled program, use:

a.out      <return>

14.   To check your disk quota, use:

    quota  -v       <return>

15.        To remove dos return characters from a text file (called file.c) transferred from notepad, use:

dos2unix –ascii  file.c  newfile.c

........ [New file without dos characters is newfile.c]

  1. To check the processes running on the computer, use:

ps                     <return>

 

  1. To read your email on davinci, launch pine as:

pine  -i  <return>

  1. To use a text editor from a remote PC, use pico as:

pico      <return>

 

  1. To use a nice text editor from an X-terminal in the campus, use:

nedit     <return>

 

  1. To remove a directory (e.g., 60-140), use:

rmdir   60-140  <return>