16
EGEE-III INFSO-RI-222667 Enabling Grids for E-sciencE Nov. 18, 2008 www.eu-egee.org EGEE and gLite are registered trademarks Unix Shell - Basic Command Line Instructions Vladimir SLavnic [email protected] Scientific Computing Laboratory Institute of Physics Belgrade, Serbia

Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

  • Upload
    others

  • View
    33

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

EGEE-III INFSO-RI-222667

Enabling Grids for E-sciencE

Nov. 18, 2008 www.eu-egee.org

EGEE and gLite are registered trademarks

Unix Shell - Basic Command Line Instructions Vladimir SLavnic [email protected] Scientific Computing Laboratory Institute of Physics Belgrade, Serbia

Page 2: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667 Introduction to Cluster and Grid Computing in Mechanical Engineering 2

Linux directory structure

Page 3: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667 Introduction to Cluster and Grid Computing in Mechanical Engineering 3

Linux Shell Terminals

•  gnome-terminal •  konsole •  xterm

Page 4: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

ls - list directory contents

ls [OPTION]... [FILE]...

List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort.

ls

Page 5: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

Almost every command has a numerous switches to use.

ls -a ls -l ls -lh ls -1

switches

Page 6: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

man

Easiest way to know how to use linux command is by using manual.

man ls

Page 7: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

pwd - print name of current/working directory

vlada@graph:~$ pwd /home/vlada vlada@graph:~$

pwd

Page 8: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

cd - change directory

absolute and relative path/addressing

. - current folder

.. - folder up ~ - home folder / - system root

mkdir - make directories

cd

Page 9: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

cp, mv, rm

cp – copy cp <path/filename> <newpath/newfilename> cp -r cp -a

mv – move mv <path/filename> <newpath/newfilename>

rm – remove rm <path/filename> rm -r rm -f

Page 10: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

chmod, chown

-rw-r--r-- 1 scl users 180 2008-11-17 14:51 linux

chmod ugo+w <path/filename>

chown username:groupname <path/file>

Page 11: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

cat - concatenate files and print on the standard output

cat [OPTION] [FILE]...

Concatenate FILE(s), or standard input, to standard output.

cat

Page 12: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

less <filename>

/<text> - find q – quit

less

Less is a program similar to more , but which allows backward movement in the file as well the forward movement.

Page 13: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

joe <filename>

CTRL+k h – help on/off CTRL+c – exit CTRL+k s – save CTRL+k x – save and exit

joe

Page 14: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

ssh

Secure shell

ssh [email protected]

ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine.

ssh [email protected] command

Page 15: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

scp

Secure copy

scp [email protected]:path/file [email protected]:path1/file1

scp -r : secure copy directories

scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security.

Page 16: Unix Shell - Basic Command Line Instructionswiki.ipb.ac.rs/.../Introduction_to_Cluster_and...Unix_Shell-2008-11-18.… · Unix Shell - Basic Command Line Instructions Vladimir SLavnic

Enabling Grids for E-sciencE

EGEE-III INFSO-RI-222667

scp

ps ps aux

Report a snapshot of the current processes.

top

Display Linux tasks

kill

Send a signal to a process