Command | Options | Syntax | Description |
ls |
(none)
-a
-l |
%> ls
%> ls -a
%> ls -l |
List all the non-hidden files in the current working directory to the console
Display all files (hidden and non-hidden) in the current working directory
Display the details of all listed files (i.e. ownership, creation time, etc.) |
echo |
(none)
-n |
%> echo (string)
%> echo -n (string) |
Print (string) followed by '\n', the <LF> character.
Print (string) (without <LF>) |
cat |
(none) |
%> cat (file path) |
Dumps the entire contents of a file to the console |
more |
(none) |
%> more (file path) |
Will display the contents of the file in the console window.
Press 'Enter' to scroll line by line. Press spacebar to scroll by page. Press 'q' to quit. |
pwd |
(none) |
%> pwd |
Displays the current working directory |
cd |
(none) |
cd (file path) |
Change current working directory to (file path) |
mkdir |
(none) |
%> mkdir (file path) |
Create a subdirectory named (file path) in the current working directory |
cp |
(none)
-r |
%> cp (src file path) (dest file path)
%> cp -r (src file path) (dest file path) |
Copy a file from "src" to "dest"
Copy a file or directory recursively from "src" to "dest" |
mv |
(none) |
%> mv (src file path) (dest file path) |
Move a file or directory from "src" to "dest" |
man |
(none) |
%> man (cmd name) |
Displays the manual page for a given command (e.g. "%> man cp" will display the manual for the "cp" command). Press "q" to quit. |
rm |
(none)
-r |
%> rm (file path)
%> rm -r (file path) |
Remove the given file.
Remove the given file or directory
BE CAREFUL WITH THIS COMMAND |
touch |
(none) |
%> touch (file path) |
If the file does not exist, this will create a new, empty file. If the file does exist, it will update the "last modified time" (do this if you want to force
something to recompile). |
ps |
-x |
%> ps -gx |
Show all the processes currently running with your username and their associated process IDs (a.k.a. PIDs). |
kill |
(none)
-9
-9 -1 |
%> kill (proc id)
%> kill -9 (proc id)
%> kill -9 -1 |
Kill the specified process.
Forcefully terminate the specified process (do this if normal "kill" doesn't work).
Forcefully kill all your processes and log you out (be careful with this). |
pico |
(none) |
%> pico (file path) |
Open the specified file using the pico editor. If the specified file does not exist, pico can create it. |
vi |
(none) |
%> vi (file path) |
Open the specified file using the vi editor. If the specified file does not exist, vi can create it. |
emacs |
(none) |
%> emacs (file path) |
Open the specified file using the emacs editor. If the specified file does not exist, Emacs can create it. |
df |
(none) |
%> df |
Show file system usage. Look for "Use%" for the "/" file system - if it's near 100%, you need to delete some files or some programs will start to fail. |
top |
(none) |
%> top |
Show active processes and resource usages (type "h" for help). Look for the amount of free memory on the "KiB Mem" line. If it's near zero, you need
to kill some processes or your system will get slower and slower. |
exit |
(none) |
%> exit |
Terminate your current shell or current login. |
Please note that the first part in a commandline must be either a built-in command of your command shell (
bash or
tcsh) or a program name.
Therefore, if you are asked to enter a particular commandline and you don't know the meaning of that line of command,
you should look at the manual (referred as "man pages") for that first part of that commandline.
For example, if you don't know what "
gcc -g -Wall -o hello hello.c" would do,
you should do "
man gcc" and look for things like "
-g", "
-W", etc., in the man pages of
gcc.