Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux Workshop Session 2 By Amol and Prem. Overview of Presentation Brief Review Useful tools Remote Access Troubleshooting.

Similar presentations


Presentation on theme: "Linux Workshop Session 2 By Amol and Prem. Overview of Presentation Brief Review Useful tools Remote Access Troubleshooting."— Presentation transcript:

1 Linux Workshop Session 2 By Amol and Prem

2 Overview of Presentation Brief Review Useful tools Remote Access Troubleshooting

3 Brief Review

4 Basic Command ls, cd, mv, cp, rm, cat, clear, tar, more, less, tail, head, mkdir …. chmod, grep, ps, kill, pkill, quota, du,df … Most important : man & --help option

5 Useful Tools find Used to search files in a directory hierarchy. find –iname e.g. find /etc/ -iname passwd chown, chgrp Used to change the ownership of the file chown/chgrp new_owner/new_group file_name

6 Useful Tools contd.. chmod Used to change the permission of the file Normally used to make file executable or define proper permission like Read, Write permissions r = 4, w = 2, x = 1 file permissions to owner, group, and other Example: to give owner full r, w and x and rest only r  4+2+1(owner) 4+0+0(group) 4+0+0(other) = 744  chmod 744 file_name or chmod u=+rwx,g=r-x-w,o=r-x-w file_name  To give execute permission to group chmod g+x filename

7 Useful Tools contd.. env Shows the current environment variables and also run a program in a modified environment Very useful to troubleshoot many command not found errors env (prints all environmental variables ) env PATH=/sbin/ test_program ( runs test_program with new value of PATH ) To display particular variable echo $variable_name E.g. echo $PATH, echo $SHELL

8 Useful Tools contd.. grep To find particular text in a text stream text stream can be a file or can be output of any other command Examples:  grep some_text./* (to find some_text in any file located in current directory, -r can be used to search recursively)  ps –ef | grep httpd ( to find if httpd process is running )

9 Useful Tools contd.. mount Used to mount new file system to local m/c Syntax: mount options source_fs dest_fol Example: mount –t vfat /dev/sdb1 /media/usb

10 Useful Tools contd.. ifconfig ( or /sbin/ifconfig ) Used to configure network intefaces. You can use this to find the IP address of the current machine Syntax: ifconfig interface options Example: ifconfig eth0 ifconfig eth0 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255

11 Useful Tools contd.. Pipes and Redirector Very useful for manipulating program output Pipes chains programs, redirector redirects output normally from output console to some file Syntax : Pipe : |, Redirector: > or >> Example: ls –la | grep owner >output.txt >> will append the existing file

12 Remote Access

13 About Accounts There is one account for each student Galaxy Account Can be used to access all the Linux machines in the lab, both locally and remotely Local Accounts Some courses like Computer Networks, AOS, NSA etc. might requires you to have local accounts in certain machines. Remotely accessing these machines using your local account is same as accessing using your main account.

14 Tools Required ssh client Linux : ssh user@galaxy.cs.lamar.edu Windows : Putty

15 scp or sftp client for your platform Linux : scp user@galaxy.cs.lamar.edu:/remote_file current_system_pathuser@galaxy.cs.lamar.edu:/remote_file sftp user@galaxy.cs.lamar.edu Windows : Winscp Optional : remote sftp compatible editor Windows : jEdit for platform that supports java and X

16 Connecting to Labs Servers Only galaxy is accessible from network outside lamar To access other machines, first login to galaxy. Then ssh to other machines Example: connect to post from outside network ssh galaxy –l galaxy_username [user@galaxy~]$ ssh mercury –l post_username

17 Upload and Download Files Locally Networked file system Remotely use your sftp client to upload or download files from galaxy for machines with local account Move files from your machines to gateway servers and then access the files from gateway server. Example: getting testfile from post via galaxy  ssh galaxy_username@galaxy.cs.lamar.edu  In ssh session: sftp post_username@post.cs.lamar.edu  In sftp session: get testfile./.  use your sftp client to access the files in galaxy

18 Remotely Editing Files Can use remote editor like jEdit to edit files directly residing on remote servers Very useful for debugging you c, c++ code Other machines remote editing is not possible currently

19 Troubleshooting

20 Common Problems GCC, G++, javac, java not found Fix: This is most likely due to path problem If this occurs set the path variable Example: export PATH=$PATH:PATH_TO_GCC Easy way: Type: source /etc/bashrc

21 Common Problems contd.. Class Not Found Error in Java Fix: use –cp option during compilation and execution Example: javac –cp ~/folder;~/folder/package test.java java –cp ~/folder;~/folder/package test Easy way: make jar files To make jar files in netbeans: Clean and Build project. jar file along with all the required classes will be created in your project_name/dist folder To run jar files  java –jar your_jar_file

22 Common Problems contd.. File Sync Error Fix: This is most likely due to lack of free space in your home directory verify using du –h command Remove.mozilla files from your home directory using rm –rf ~/.mozilla Remove other files if you still need more space Easy way: Append “rm –rf ~/.mozilla” line to the.chrc file located in your home directory. This will clean your cache each time you login

23 In the End These are only basics of Linux, next step can be knowing how to write scripts. Linux can be shaped to any form you like. The more you work with Linux, the more you will know how computers, devices and networks works. Thanks!


Download ppt "Linux Workshop Session 2 By Amol and Prem. Overview of Presentation Brief Review Useful tools Remote Access Troubleshooting."

Similar presentations


Ads by Google