User Tools

Site Tools


howto:unix_shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:unix_shell [2018/11/08 17:48] jnilssonhowto:unix_shell [2024/06/01 00:24] (current) – [2. Open the terminal or connect to the remote Linux server] jnilsson
Line 6: Line 6:
  
 ===== 1. Obtaining software ===== ===== 1. Obtaining software =====
-Step one is to obtain some terminal software. If you are on a Linux or a Mac computer, you already have this! Look for your Terminal application. But if you are on a Windows PC, you'll need to install either an SSH client, or a terminal emulator. You have a couple options, but I recommend sticking with just the first one:+Step one is to obtain some terminal software. If you are on a Linux or a Mac computer, you already have this! Look for your Terminal application. If you are on a Windows PC, you might need to install either an SSH client, or a terminal emulator. You have a couple options:
  
 +  - Try opening the Windows Terminal and see if you can use the ''ssh'' command (it might be installed already)
   - [[https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|Download PuTTY.exe on this website]]   - [[https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|Download PuTTY.exe on this website]]
   - [[https://cygwin.com/install.html|Install Cygwin]] - this is a much more advanced option, not recommended for the faint of heart as it installs a linux emulation layer on top of Windows and requires selection of desired packages to be installed.   - [[https://cygwin.com/install.html|Install Cygwin]] - this is a much more advanced option, not recommended for the faint of heart as it installs a linux emulation layer on top of Windows and requires selection of desired packages to be installed.
   - [[https://docs.microsoft.com/en-us/windows/wsl/install-win10|Install the Microsoft "Bash on Windows" subsystem for linux]] - this might be appropriate if you want a more officially supported linux emulation layer on top of Windows. If you are curious, this installs a debian-like linux distro, complete with "apt" to install desired packages.   - [[https://docs.microsoft.com/en-us/windows/wsl/install-win10|Install the Microsoft "Bash on Windows" subsystem for linux]] - this might be appropriate if you want a more officially supported linux emulation layer on top of Windows. If you are curious, this installs a debian-like linux distro, complete with "apt" to install desired packages.
 +
  
  
 ===== 2. Open the terminal or connect to the remote Linux server ===== ===== 2. Open the terminal or connect to the remote Linux server =====
  
-If you installed either options 2. Cygwin or 3. Bash on Windows above, then you can practice these commands on your local computer. If you are on a Linux or Mac computer, you can also practice on your local computer.+If you installed either options 3. Cygwin or 4. Bash on Windows above, then you can practice the commands and tutorials listed below on your local computer. If you are on a Linux or Mac computer, you can also practice on your local computer
 + 
 +If your Windows Terminal application comes with the ssh command, you can run the command below to connect to a remote Linux server.
  
-  * Open the terminal application to get started +  * Open the terminal application, then run this command to connect to a remote linux system using SSH:<code>
-    - If you want to connect to a remote linux system using SSH, you can do so with a command like this:<code bash>+
 ssh <username>@<servername> ssh <username>@<servername>
-#for example: ssh jnilsson@nexus.ss.uci.edu+#for example: ssh jnilsson@nexus.socsci.uci.edu
 </code> </code>
  
 Or, if you installed PuTTY.exe or another SSH client program, you will need to connect to the remote linux server. Or, if you installed PuTTY.exe or another SSH client program, you will need to connect to the remote linux server.
  
-  * Open PuTTY and enter the hostname of the server, optionally set any connection options you need, then click on Open. It will prompt you for your username and password, but when you type the password, it will not print anything to the screen. This is normal.+  * PuTTY and enter the hostname of the server, optionally set any connection options you need, then click on Open. It will prompt you for your username and password, but when you type the password, it will not print anything to the screen. This is normal.
  
 ===== 3. Run through a tutorial ===== ===== 3. Run through a tutorial =====
Line 32: Line 35:
  
   * [[http://swcarpentry.github.io/shell-novice/]]   * [[http://swcarpentry.github.io/shell-novice/]]
 +
 +
 +
 +
  
  
Line 40: Line 47:
 Here are the most important commands to make sure you are familiar with: Here are the most important commands to make sure you are familiar with:
  
-  * ''passwd'' use this to change your password. If you have not done this yet, do it now!+  * ''passwd'' (use this to change your password. If you have not done this yet, do it now!)
   * ''pwd''   * ''pwd''
   * ''ls''   * ''ls''
Line 46: Line 53:
   * ''mkdir''   * ''mkdir''
   * ''rmdir''   * ''rmdir''
 +  * ''cp''
   * ''mv''   * ''mv''
-  * ''rm'' be very careful with this! It might not ask you to confirm before deleting +  * ''rm'' (be very careful with this! It might not ask you to confirm before deleting) 
-  * text editor: ''vim'', ''emacs'', or ''nano''+  * ''vim'', ''emacs'', or ''nano'' (text editor of your choice)
   * ''cat''   * ''cat''
   * ''less'' or ''more''   * ''less'' or ''more''
   * ''grep''   * ''grep''
 +  * ''sort''
 +  * ''tail''
 +  * ''head''
 +
 +
 +===== 5. Important shell concepts =====
 +
 +  * Output redirection: ''>'' or ''%%>>%%''
 +  * Input redirection: ''<''
 +  * Piping commands together: ''|''
 +  * Shell globs and character pattern matching: ''[A-Za-z0-9]'', ''*'', ''?''
 +  * Regular expressions to use with ''grep'' - [[https://regexone.com/|see this tutorial]]
howto/unix_shell.1541699287.txt.gz · Last modified: 2018/11/08 17:48 by jnilsson