Unix Commands
script
command creating a file called "typescript"
finger
command displaying a list of user id's with names
more
command displaying large files only one screen at a time; followed by the name of the file
pwd
command displaying where you are currently at in the directory; command to print working directory
cat
command displaying your file on screen; follwed by the name of the file
who
command displays a list of user id's
./
command executing a program; followed by the executable with no space (note NO extension)
whoami
command giving your user id
ls -al
command listing all files including normally hidden files
man
command to bring up help on a certain command (pretty much a manual); followed by the name of the command you would like to understand
cd
command to change directory; followed by name of directory or subdirectory you'd like to go to
clear
command to clear the screen
pico
command to create a new file using pico text editor
ls -l
command to display a long listing
ls
command to display files and subdirectories in a directory; also known as "list command"
date
command to display the date
cd ..
command to go back one directory
exit
command to log off the server and exit putty
cp
command to make a copy of a file; followed first by the file being copied, second by the name of the copy
mkdir
command to make a new directory; followed by what you would like to name that directory
mv
command to rename or move a file; followed first by the file being renamed, second by the name you would like to change it to
gnatmake
command used to compile a program written in a file; followed by the file name. (in our class, the file ends in .adb, meaning it is an Ada program.) this command makes three new files ending in .ali, .o, and one without an extension called the executable.
rm
command used to delete file(s); followed by the name of the file being deleted
a2ps
command used to print a file in 214 Blackington; followed by the file name
CTRL X
keyboard command to save a pico text file and then exit the editor
CTRL O
keyboard command to save a pico text file while staying in the editor
pico +20 program.adb
Consider the command prompt notifies you that there is an error in line 20 of your program called "program.adb"; what command would you use to get there?
username
Application: Given that you are currently in directory cs410 of home/username/private/cs410, if you typed in the command "cd .." twice, what directory would you be in?
private
Application: Given that you are currently in directory cs410 of home/username/private/cs410, if you typed in the command "cd ..", what directory would you be in?
no
Are the commands 1 & 2 any different? (1) cd private cd cs410 (2) cd private/cs410
more sample.txt
If you wanted to display the contents of sample.txt only one page at a time, what command would you type?
cat sample.txt
If you wanted to display the contents of sample.txt, what command would you type?
man more
If you would like to understand the "more" command better, what command would type to find information?
./program
What command would you type to execute the program contained in program.adb, after completing the gnatmake command?
pwd and ls
What commands should you use when you don't know where you are at?
script; cat taxes.adb; gnatmake taxes.adb; ./taxes; exit
What series of command should you use to create a script file and record your session of a program called "taxes.adb"? (separate lines with semicolons.)
