head and tail
head and tail (respectively) lets you look at the first or last bits of a file
head and tail
head and tail (respectively) lets you look at the first or last bits of a file
less is what's known as a pager. It will display one page of a file at a time and let you scroll up and down through the file at your leisure.
less displays the contents of a file one 'page' at a time
cat has nothing to do with cats. It's short for catenate, and it dumps the contents of text files.
cat dumps the contents of a plain text file. Note can be sub-optimal for large files
rm
Use rm to remove/delete files/directories. Warning: there is no recycle bin/trash — deleting is permanent!
cp
Use cp to copy files/directories
mv
Use mv to move files from one directory to another
mkdir
Use mkdir to create a new directory
.. is a special directory name meaning “the directory containing this one”, or more succinctly, the parent of the current directory
Use cd .. to go up a directory from the one you're currently in
The cd command is akin to double clicking a folder in a graphical interface to get into a folder
Use cd to change into a new directory
pwd shows you where you are
The pwd command tells you what your Present Working Directory is
So let’s try our first command, ls which is short for listing. This command will list the contents of the current directory
Use ls to list the contents of a directory
The shell is a program where users can type commands. With the shell, it’s possible to invoke complicated programs like climate modeling software or simple commands that create an empty directory with only one line of code.
What is a command shell?
Using a GUI, you would not only be clicking at your desk for several hours, but you could potentially also commit an error in the process of completing this repetitive task. This is where we take advantage of the Unix shell. The Unix shell is both a command-line interface (CLI) and a scripting language, allowing such repetitive tasks to be done automatically and fast.
Why would I want to use a command shell?