Command | Usage |
---|---|
pwd |
Print the current "working directory", the one you are in |
ls |
List everything in the current directory |
cd <directoryname> |
Move to the directory named directoryname |
mkdir <directoryname> |
Create a directory named directoryname in the current directory |
cp <filename1> <filename2> |
Make a copy of filename1 called filename2 |
mv <filename1> <filename2> |
Move the contents of filename1 to filename2 (deletes filename1) |
rm <filename> |
Delete (permanently and irreversibly) the file filename |
vim <filename> |
Open the file named filename in vim |
Command | Usage |
---|---|
i |
Enter Insert Mode |
Esc |
Exit whatever mode you're in |
:w |
Save the file (write) |
:q |
Exit vim |
:wq |
Write the file and exit vim |
pwd
command. It stands for "print working directory".ls
.cd /cs/student/maradowning/example
or
cd example
cd .
cd ..
mkdir
command ("make directory"). It will make a new directory inside of your current one:cp
(copy) and mv
(move). These both take two arguments: the file to be copied or moved, and a destination file. For example, if I want to copy myfile.txt into mysecondfile.txt, I would run:cp myfile.txt mysecondfile.txt
Now I have two identical files in the same directory, except for their names.mv myfile.txt ../myfile.txt
or mv myfile.txt ../
mv myfile.txt myrenamedfile.txt
rm
(remove). You should be a little careful with this one, because unlike moving a file to trash, rm
is irreversible. To use rm
, you just list any files you want to delete:rm myfile.txt
rm myfile.txt mysecondfile.txt
vim samplevimfile.txt