linux
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux [2016/05/10 07:29] – bedutra | linux [2026/06/24 19:48] (current) – removed lnor | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| - | ====== Linux Tutorial ====== | ||
| - | |||
| - | This tutorial is intended to be a practical and brisk tutorial of many of the basics of using Linux for people who have never used it before. Setting up a website, compiling LaTeX, firing up MatLAB, and other typical tasks math grads would want from the department computers are covered quickly. | ||
| - | |||
| - | By using the related tools mentioned here, you can do things such as modify your webpage, retrieve/ | ||
| - | |||
| - | ===== Connecting to a Linux computer ===== | ||
| - | |||
| - | If you are using one of the Ubuntu computers in the computer lab or in your office, there is nothing special you have to do. Just open the " | ||
| - | |||
| - | If you are on your own computer, you first need to connect to the math's computers. | ||
| - | |||
| - | Some good SSH clients include | ||
| - | |||
| - | * Windows: [[http:// | ||
| - | * Mac: See the Mac program " | ||
| - | |||
| - | For details on how to connect to a math server, see the computer FAQ [[https:// | ||
| - | |||
| - | |||
| - | ===== The Basics ===== | ||
| - | |||
| - | The first thing you should do is watch this [[https:// | ||
| - | |||
| - | * ls (for listing a directory) | ||
| - | * pwd (printing current path) | ||
| - | * cd (for moving around in folders) | ||
| - | * mkdir (making folders) | ||
| - | * mv (moving things) | ||
| - | * rm (removing things) | ||
| - | * cp (copy things) | ||
| - | * man (help) | ||
| - | * chmod (file permissions) | ||
| - | * tab completion | ||
| - | |||
| - | |||
| - | Once you successfully connect to a terminal, you are given a prompt where you can type commands. This section is devoted to introducing some everyday commands. In what follows, when in doubt, Linux is typically case-sensitive! | ||
| - | |||
| - | |||
| - | ==== The folder system and your home directory ==== | ||
| - | Like on your own computer, Linux has a folder (sometimes called a directory) structure. | ||
| - | |||
| - | Some special directories have special symbols. | ||
| - | |||
| - | |||
| - | ==== Navigating directories ==== | ||
| - | |||
| - | |||
| - | To see what directory you're in at a given moment, you can type < | ||
| - | |||
| - | To move to a different directory, use the command " | ||
| - | |||
| - | To get back to your home directory, use < | ||
| - | |||
| - | ==== Creating, deleting, moving, and renaming directories ==== | ||
| - | |||
| - | In your home directory, suppose you want to create a subdirectory (to store, for example, the scratch work of the rest of this tutorial). | ||
| - | |||
| - | To delete the directory learnlinux type < | ||
| - | |||
| - | Now, test1 is a subfolder of test2. You can rename test2 to test3 by typing < | ||
| - | |||
| - | ==== Creating, deleting, and renaming files ==== | ||
| - | |||
| - | |||
| - | To create a blank file called myfile.txt in the current directory, type < | ||
| - | |||
| - | To rename the text file, type < | ||
| - | |||
| - | To delete the file, type < | ||
| - | |||
| - | ==== File permissions ==== | ||
| - | |||
| - | This is very important. You do not want other people to read, edit or delete your important files. You can recursively set permissions with chmod. | ||
| - | |||
| - | |||
| - | ==== Editing text files directly ==== | ||
| - | |||
| - | You have two basic ways of modify files. One option is to download them to your computer, edit them like normal, and then save them back to the math servers. Your other basic way to modify files is directly in the terminal using a text-based text editor. | ||
| - | |||
| - | The three most-popular text editors on Linux are called " | ||
| - | |||
| - | |||
| - | Search online for great tutorials on pico, vi, emacs. | ||
| - | |||
| - | ==== Using LaTeX ==== | ||
| - | |||
| - | See the [[: | ||
| - | |||
| - | Suppose you have a valid LaTeX file called mytheorem.tex in the present working directory. | ||
| - | |||
| - | If your LaTeX file is invalid, you will not reach the normal prompt and instead be given a question mark. You can type a capital X or " | ||
| - | |||
| - | ===== Advanced Commands ===== | ||
| - | |||
| - | These commands are also useful | ||
| - | |||
| - | * grep (search in files) | ||
| - | * find (search for files) | ||
| - | * unix pipe operator (you can do magic with this) | ||
| - | * sed | ||
| - | * awk (good for super crazy things) | ||
| - | * screen or tmux (good for running long compute jobs | ||
| - | * top or htop | ||
| - | * input and output redirection | ||
| - | |||
| - | Basically, there is a command for everything. If you want to do something, just search the internet for "how to X unix command" | ||
| - | |||
| - | |||
| - | ===== Transferring files ===== | ||
| - | |||
| - | It is so easy to just use a (S)FTP program like WinSCP or FileZilla. | ||
| - | |||
| - | You could also use unix commands to transfer files...see sftp, put and get. | ||
linux.1462865393.txt.gz · Last modified: by bedutra
