FAQ: git, vi, bash shell
Common bash shell
# print working directory
$ pwd
# list contents of current directory
$ ls
# list contents of <dir>
$ ls <dir>
# list all/hidden files
$ ls -a
# take me to my home directory
$ cd
# change directory to <dir name>
$ cd <dir>
# change to directory above
$ cd ..
# print file to your screen
$ cat <filename>
# make directory
$ mkdir <dir_name>
# delete a file
$ rm <filename>
# recursively delete a directory -- BE VERY CAREFUL WITH THIS COMMAND!!
$ rm -rf <directory-name>
# copy a file from its current directory to another directory location
$ cp <filename> <directory-location>
# move a file from current directory to another directory location
$ mv <filename> <directory-location>
# rename a file in current directory -- applies to filename or directory name
$ mv <oldname> <newname>
# move & rename a file from current directory to directory above
$ mv <filename> ../<new-filename>
# open up an in-terminal text editor (note the shortcuts along the bottom)
$ nano
# edit a file
$ nano <filename>Common vi commands
Common Git commands
How do I revert previous commit?
What is "non-fast-forward"?
Last updated
Was this helpful?