Commands
Various
pwd |
print working directory |
echo something |
print stuff out |
cd dir |
change directory to dir |
cd |
change directory to $HOME |
gzip file |
compress file |
gzip -d file |
decompress file |
grep pattern ... |
print lines from input that match pattern |
Listing files
ls |
list files in current directory |
ls dir |
list files in dir |
ls -l |
long listing with sizes, permissions, etc |
ls -t |
in order by last modified time |
ls -s |
in order by size |
ls -r |
reverse order |
ls -F |
add filetype markers:
/ |
directory |
* |
executable |
@ |
symbolic link |
|
Moving files
mv old new |
move or rename file |
cp old new |
copy file |
rm file |
remove file |
emacs
To run
emacs |
new emacs |
emacs file |
new emacs for file |
emacs -nw |
new emacs without a new window |
Key commands
C-x means hold the "control" key and press x.
M-x means hold the "meta" or "alt" key and press
x. If you have no "meta" or "alt" key, you can also press
the ESC key and then press x.
Basic |
C-x C-c |
quit |
C-h t |
Emacs tutorial |
Files |
C-x s |
save current buffer |
C-x f |
open a new buffer for a file |
C-x b |
Select a different buffer |
C-x C-b |
Menu of all buffers |
Moving around |
arrows |
move up, down, left, right |
C-a |
Beginning of the line |
C-e |
End of the line |
M-< |
Beginning of the file |
M-> |
End of the file |
C-v |
down a screenfull |
M-v |
up a screenfull |
Split screen |
C-x 2 |
split window in two horizontally |
C-x 1 |
unsplit window |
C-o |
Move to the other frame |