Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can probably get by without learning much, but this guide will cover a bare minimum that anyone interacting with linux machines should know.

First open terminal Terminal.

If you are in one the CSIL computer labs, log in and select Gnome as the desktop environment (it will be in a little dropdown box after you enter your password).

...

because that is the absolute path to the homework directory.

The latter is more precise because it tells the computer exactly where to look.

The former, on the other hand, implies that since you are currently within the home directory, a ~/ should be appended to the beginning of the relative path (homework).

Keep in mind that the former will, therefore, only work when run in the home directory.

...

Code Block
languagebash
themeFadeToGrey
mkdir homework

and press enter.

This will make a directory called homework.

Once the directory is created, navigate to it using the cd command

...

If you don't feel like typing homework all the way out, just type cd homew and press Tab.

This should autocomplete it for you.

Once you are in the homework directory, you can navigate back the home directory by entering either

...

Now we are going to make a file so you can learn how to remove, move, rename, and copy it.

There are many ways to do this, but for this example we will create a file using a program called vim.

Let's call the file myhw.txt:

...

Vim is an example of an application that runs through the terminal.

Although vim is not a standard bash command, it comes preinstalled on all of the CSIL machines.

Once you are in vim, press i, for insert, and type "Hello, World!".

When you are done, press Esc and then :wq and then enter (this writes/saves the changes and then quits out of vim).

Your new file myhw.txt has now been created.

In order to list the new file and every other file and directory within your current directory, type

Code Blockpanel
languageborderColorbashblack
themeborderStyleFadeToGreysolid

ls

when you run this, you should see myhw.txt along with the homework directory and possibly some other files.

In order to copy "myhw.txt" into the homework directory, type

...

This basically moves the contents of "myhw.txt" and put it inside "yourhw.txt".

The mv and cp commands are very similar, but have one key difference:

cp copies the file and leaves the original, whereas mv moves the file and deletes the original.

Mv can also be used to move files to other directories.

In order to move "yourhw.txt" into your home directory, enter either

...

Code Block
languagebash
themeFadeToGrey
cd ~

and the enter

Code Blockpanel
languageborderColorbashblack
themeborderStyleFadeToGreysolid
ls

in order to list your files.

You should see myhw.txt, yourhw.txt, and the directory homework (among other directories).

To prove that we really did copy and move myhw.txt, enter

...

which will remove all files ending in "hw.txt".

Now in order to remove the homework directory, you have to include a flag, which is basically a parameter that specifies how the command should be run:

...

Now that you understand these basic commands, you are now ready to use the linux command line.

A quick start to VIM for Beginners - https://eastmanreference.com/a-quick-start-guide-for-beginners-to-the-vim-text-editor

A beginner's guide to Linux Command Line - https://www.techspot.com/guides/835-linux-command-line-basics/

Cheat sheets, courtesy of UCSB's Center for Scientific Computing

terminal_commands.pdf

terminal_commands2.pdf

vi-CheatSheet.pdf

Filter by label (Content by label)
showLabelsfalse
max5
spacesEPK
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "command-line" , "permission" ) and type = "page" and space = "EPK"
labelscommand-line

...