ssh
and must be run from the command line ...bash
and it has many useful featuresls
ls
stands for listls
on the command line and nothing more ...$ ls memo.txt notes.txt
ls
on some other directory ...$ ls /courses cs105 cs411 cs611 cs656 cs768 cs108 cs420 cs612 cs664 cs799 cs109 cs430 cs615 cs670 cs999 ...
pwd
(print wworking directory) command
$ pwd /courses/it244/s18
ghoffman@itserver6:/courses$
ghoffman@itserver6:/courses$
ghoffman@itserver6:/courses$
$ ls /courses cs105 cs411 cs611 cs656 cs768 cs108 cs420 cs612 cs664 cs799 cs109 cs430 cs615 cs670 cs999 ...
cd
command$ cd /courses
ls
right after cd
...cd
command ...cd
ls
without options simply lists the contents of a directory
$ ls tmp empty.txt ex23.py notes
ls
with the -l
option it will provide more
information on each entry in the directory
$ ls -l tmp total 8 -r--r--r-- 1 ghoffman faculty 0 Jul 19 13:57 empty.txt -rwxr-xr-x 1 ghoffman faculty 1457 Jul 19 16:03 ex23.py drwxr-xr-x 2 ghoffman faculty 4096 Jul 19 12:56 notes
$ LS The program 'LS' is currently not installed. To run 'LS' please ask your administrator to install the package 'sl'
Command | Meaning |
---|---|
Control A | Move to the beginning of the line |
Control E | Move to the end of the line |
Control U | Remove everything from the text entry point to the beginning of the line |
Control K | Remove everything from the text entry point to the end of the line |
Control _ | Undo the last command line change |
→ | Move the text entry point one character to the left |
← | Move the text entry point one character to the right |
↑ | Recall the previous command line entry in the history list |
↓ | Recall the following command line entry in the history list |
emacs
vi
nano
emacs
and vi
are full featured editors ...nano
is a simple editor that does not have many featuresemacs
tends to be used by people who write codevi
tends to be used by system administratorsemacs
or vi
...nano
nano
write nano
...$ nano hello.py
nano
use control key sequences
nano
nane
here
nano
followed by the name of the file
$ nano hello.py
cp
which takes two arguments$ cp hello.py hello2.py
$ cp hello.py project1
-r
option
$ cp -r project1 new_project
rm
command$ rm memo.txt
rm
cannot remove a directory without a special optionmkdir
command ...$ mkdir temp
rmdir
command$ rmdir temp
rmdir
cannot remove a directory if it has anything inside itmv
commandmv
takes two arguments ...$ mv memo.txt temp
mv
when you want to change the name of a file or directory
$ mv memo.txt note.txt
ls
ls
with the -a option
$ ls it116 it244 $ ls -a . .. .bash_history .bash_profile it116 it244
cd ..
$ cp notes/note_1.txt .
Glenn Hoffman 40 Central Street Somerville, Massachusetts 02143 USA
Turn left when you leave my office When you come to the corridor turn right Walk all the way down he corridor Just before you reach the end of the corridor you will see a window That is the CS office
/home/ghoffman
$ echo ~ /home/ghoffman
$ echo ~it244gh /home/it244gh
cat
on the file notes.txt ...$ cat notes.txt
cat
on the file notes.txt ...$ cat work/notes.txt
cat
on the file notes.txt ...$ cat ../../notes.txt
cat
on the file
notes.txt ...$ cat ../frank/notes.txt