Download Presentation Source

Total Page:16

File Type:pdf, Size:1020Kb

Download Presentation Source UNIX Tip of the Day UNIX Tip of the Day • Directory maneuvering commands % dirs pushd, popd, and, dirs /cis/staff/rvrpci /usr/tmp Shell Programming % cd /usr/tmp % pushd % pwd % pwd /usr/tmp /usr/tmp % pushd ~rvrpci % dirs % pwd /usr/tmp /cis/staff/rvrpci /cis/staff/rvrpci % pushd /usr/local/bin Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 UNIX Tip of the Day UNIX Tip of the Day UNIX Tip of the Day % dirs % dirs % dirs /usr/local/bin /usr/tmp /usr/tmp /usr/local/bin /cis/staff/rvrpci /usr/tmp /cis/staff/rvrpci /cis/staff/rvrpci /usr/local/bin % pwd % pwd % popd /usr/local/bin /usr/tmp % dirs % pushd % pushd +2 /usr/tmp /usr/local/bin % dirs % pwd /usr/tmp /usr/local/bin /cis/staff/rvrpci /cis/staff/rvrpci Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 What is shell programming? .login file .cshrc file • Shell programming set path=($HOME/bin /usr/local/bin \ if ($?prompt) then /usr/ucb /usr/sbin /bin /usr/bin \ set notify –automate a set of UNIX commands. /usr/bin/X11 .) set history = 100 –Just like any programming language stty dec new set savehist = 100 –“wrappers” tset -I -Q alias pd pushd • black box a customized collection of UNIX set mail=/usr/spool/mail/$USER alias pop popd commands. set editmode = emacs alias vt100 "set term = vt100" –Example of shell programs umask 077 endif .login biff n .cshrc date Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 When these files are Other useful .login/.cshrc executed? User defined shell program .cshrc entries –is automatically executed when you start a set filec • Determine name of command new shell set cdpath=(~ ~rvrpci/pub ~/mythesis) • Determine input, output, and option .login arguments –only gets executed once when you first Other common entries login • Determine UNIX commands to execute • Establish error trapping set path=( $path /usr/local/bin) Can be re-executed by giving the source set path=(/usr/local/bin $path) • Make shell program executable command % source .cshrc Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 A simple shell program We would rather see... Special Shell Variables Set • dd command to swap bytes % swap_bytes input.dat output.dat % swap_bytes input.dat output.dat % dd if=input.dat of=output.dat $0 $1 $2 bs=2 conv=swab command $argv[1] $argv[2] • Very difficult to remember • Very little utility to non-UNIX geeks (normal people) Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Another Special shell program Making swap_bytes Shell Variables swap_bytes shell script executable % swap_bytes input.dat output.dat #!/bin/csh -f % ls -l swap_bytes dd if=$1 of=$2 bs=2 conv=swab -rw------- ... swap_bytes $#argv % chmod u+x swap_bytes % ls -l swap_bytes Indicates how many arguments are present -rwx------ ... swap_bytes In this case, 2 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 To run swap_bytes Limitation of swap_bytes Improvement to swap_bytes • swap_bytes becomes just another • No error trapping #!/bin/csh -f unix command! • Should give usage when typing command if ( $#argv != 2 ) then echo "usage: $0 input_file output_file" exit 1 % swap_bytes endif % swap_bytes input.dat output.dat usage: swap_bytes input_file output_file dd if=$1 of=$2 bs=2 conv=swab Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Informational message from Commad exit status Interactive swap_bytes swap_bytes • By convention • UNIX style informational message • If you want a “friendlier” shell program –Have it query the user for the inputs exit 0 % swap_bytes Indicates successful command completion usage: swap_bytes input_file output_file • Another special shell variable can be used exit 1 (or non-zero) Indicates some error condition $< Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Interactive swap_bytes Interactive swap_bytes example #!/bin/csh -f • User simply types the command if ( $#argv != 2 ) then echo -n "Please enter the input file> " UNIX Quotes % swap_bytes set input=$< Please enter the input file> input.dat echo -n "Please enter the output file> " Please enter the output file> output.dat set output=$< endif dd if=$input of=$output bs=2 conv=swab Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 A more complex shell program A note about quotes in UNIX A note about shell variables • In pbmplus utilities, % set a=ls • Shell variables can also double up as rawtopgm conversion exists % echo a arrays % echo $a pgmtoraw conversion does not • Using the previous example, % set b=“$a” • A version of pgmtoraw in a % echo $b % echo $b programming language like C % set b=‘$a’ % echo $b[1] –Time consuming % echo $b % set b=`$a` % echo $#b –Program will likely be used infrequently % echo $b % echo $b[$#b] • Solution: shell program Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Define input and output files Dimensions of input image pgmtoraw shell script design pgmtoraw ( pnmfile) • Define input and output files #!/bin/csh -f % more test_data.pgm P2 • Figure out dimensions of input image set command_name=$0 set number_args=$#argv 3 3 • Determine number of bytes for input image if( $number_args != 1 ) then 255 • Determine number of bytes for header echo “usage:$command_name input_file_name” 1 2 3 4 5 6 • Need to strip out the header bytes exit 1 endif 7 8 9 • Write out headerless image data . % pnmfile test_data.pgm . test_data.pgm: PGM plain, 3 by 3 maxval 255 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 pgmtoraw (continued) pgmtoraw (continued) Resulting pgmtoraw utility set input_file=$1 set file_info=`wc -c $input_file` • Uses existing routines to obtain information set bytes_in_file = $file_info[1] set pnm_info = `pnmfile $input_file` pnmfile set image_type = $pnm_info[2] @ header = $bytes_in_file - $image_bytes wc set data_type = $pnm_info[3] dd if=$input_file bs=$pixel_bytes skip=$header set width = $pnm_info[4] dd set height = $pnm_info[6] • Functional tool written in 20 command lines set maxval = $pnm_info[8] set pixel_bytes = 1 @ image_bytes = $width * $height Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Current Limitations of Shell Scripts Wrappers pnmtojpeg.pro Resulting pgmtoraw utility and IDL • No check between “ASCII” vs. “RAW” pgm • Another utility missing in pbmplus pro pnmtojpeg, input_file, output_file if( data_type == ‘plain,’) ... jpegtopnm or pnmtojpeg • No provisions for multibyte per pixel case read_ppm, input_file, image –Use pnmfile results to check for above cases • IDL has jpeg read/write capability write_jpeg, output_file, image –endian case needs to be addressed for –Create a “wrapper” that makes an idl multibyte case program pbmplus-like • Above conditions can be addressed by suite end of UNIX commands Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Usage of pnmtojpeg.pro in IDL Usage of pnmtojpeg.pro in IDL IDL_PATH environment variable IDL> pnmtojpeg,‘image.pnm’,’image.jpg’ IDL> pnmtojpeg,‘image.pnm’,’image.jpg’ setenv IDL_DIR /cis/common/rsi/idl_5 setenv IDL_PATH • For IDL to automatically find pnmtojpeg.pro \+$IDL_DIR/lib:\+$IDL_DIR/examples: \+/dirs/common/rsi/idl_5:\+/dirs/common/lib/idl :\+~/lib/idl –It must be in the current working directory –Directory containing pnmtojpeg.pro must be defined in the ENVIRONMENT VARIABLE • IDL_PATH Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Usage of pnmtojpeg.csh pnmtojpeg.csh Limitation of pnmtojpeg.csh % pnmtojpeg.csh image.pnm image.jpg #!/bin/csh -f • Does not conform to pbmplus piping, echo pnmtojpeg “,” “’”$1”’” “,” “’”$2”’” | idl i.e., % tifftopnm file.tif | pnmscale 2.0 > new_file.pnm • No error trapping Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Usage cases of pnmtojpeg Usage cases of pnmtojpeg Usage cases of pnmtojpeg (no command line arguments) (1 command line argument) (2 command line argument) % tifftopnm file.tif | pnmscale 2.0 | pnmtojpeg > new_file.jpg % pnmtojpeg image.pnm > image.jpg % pnmtojpeg image.pnm image.jpg Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Rolando V. Raqueño Saturday, January 8, 2000 Yet another wrapper Code for no argument case Code for 1 argument case pnmtojpeg #!/bin/csh -f if($#argv == 0) then else if($#argv ==1) then set input_file = /usr/tmp/$0_input_$$ set input_file = $1 # If user interrupts process, jump to stop set output_file = /usr/tmp/$0_output_$$ set output_file = /usr/tmp/$0_output_$$ onintr stop cat > $input_file pnmtojpeg.csh
Recommended publications
  • Servo Motor EMMT-AS-60-L-LS-RM Part Number: 5242213
    Servo motor EMMT-AS-60-L-LS-RM Part number: 5242213 Data sheet Feature Value Short type code EMMT-AS Ambient temperature -15 °C ... 40 °C Note on ambient temperature Up to 80°C with derating of -1.5% per degree Celsius Max. installation height 4000 m Note on max. installation height As of 1,000 m: only with derating of -1.0% per 100 m Storage temperature -20 °C ... 70 °C Relative air humidity 0 - 90% Conforms to standard IEC 60034 Temperature class as per EN 60034-1 F Max. winding temperature 155 °C Rating class as per EN 60034-1 S1 Temperature monitoring Digital motor temperature transmission via EnDat® 2.2 Motor type to EN 60034-7 IM B5 IM V1 IM V3 Mounting position optional Degree of protection IP40 Note on degree of protection IP40 for motor shaft without rotary shaft seal IP65 for motor shaft with rotary shaft seal IP67 for motor housing including connection components Concentricity, coaxiality, axial runout to DIN SPEC 42955 N Balance quality G 2.5 Detent torque <1.0% of the peak torque Storage lifetime under nominal conditions 20000 h Interface code, motor out 60P Electrical connection 1, connection type Hybrid plug Electrical connection 1, connector system M23x1 Electrical connection 1, number of connections/cores 15 Electrical connection 1, connection pattern 00995913 Pollution degree 2 Note on materials RoHS-compliant Corrosion resistance class CRC 0 - No corrosion stress LABS-Conformity VDMA24364 zone III Vibration resistance Transport application test with severity level 2 to FN 942017-4 and EN 60068-2-6 10/2/21 - Subject to change - Festo AG & Co.
    [Show full text]
  • Administering Unidata on UNIX Platforms
    C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData Administering UniData on UNIX Platforms UDT-720-ADMU-1 C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\ADMINUNIX\ADMINUNIXTITLE.fm March 5, 2010 1:34 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Notices Edition Publication date: July, 2008 Book number: UDT-720-ADMU-1 Product version: UniData 7.2 Copyright © Rocket Software, Inc. 1988-2010. All Rights Reserved. Trademarks The following trademarks appear in this publication: Trademark Trademark Owner Rocket Software™ Rocket Software, Inc. Dynamic Connect® Rocket Software, Inc. RedBack® Rocket Software, Inc. SystemBuilder™ Rocket Software, Inc. UniData® Rocket Software, Inc. UniVerse™ Rocket Software, Inc. U2™ Rocket Software, Inc. U2.NET™ Rocket Software, Inc. U2 Web Development Environment™ Rocket Software, Inc. wIntegrate® Rocket Software, Inc. Microsoft® .NET Microsoft Corporation Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation Windows® Microsoft Corporation Windows® 7 Microsoft Corporation Windows Vista® Microsoft Corporation Java™ and all Java-based trademarks and logos Sun Microsystems, Inc. UNIX® X/Open Company Limited ii SB/XA Getting Started The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them. License agreement This software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice.
    [Show full text]
  • Autocad Command Aliases
    AutoCAD and Its Applications Advanced Appendix D AutoCAD Command Aliases Command Alias 3DALIGN 3AL 3DFACE 3F 3DMOVE 3M 3DORBIT 3DO, ORBIT, 3DVIEW, ISOMETRICVIEW 3DPOLY 3P 3DPRINT 3DP, 3DPLOT, RAPIDPROTOTYPE 3DROTATE 3R 3DSCALE 3S 3DWALK 3DNAVIGATE, 3DW ACTRECORD ARR ACTSTOP ARS -ACTSTOP -ARS ACTUSERINPUT ARU ACTUSERMESSAGE ARM -ACTUSERMESSAGE -ARM ADCENTER ADC, DC, DCENTER ALIGN AL ALLPLAY APLAY ANALYSISCURVATURE CURVATUREANALYSIS ANALYSISZEBRA ZEBRA APPLOAD AP ARC A AREA AA ARRAY AR -ARRAY -AR ATTDEF ATT -ATTDEF -ATT Copyright Goodheart-Willcox Co., Inc. Appendix D — AutoCAD Command Aliases 1 May not be reproduced or posted to a publicly accessible website. Command Alias ATTEDIT ATE -ATTEDIT -ATE, ATTE ATTIPEDIT ATI BACTION AC BCLOSE BC BCPARAMETER CPARAM BEDIT BE BLOCK B -BLOCK -B BOUNDARY BO -BOUNDARY -BO BPARAMETER PARAM BREAK BR BSAVE BS BVSTATE BVS CAMERA CAM CHAMFER CHA CHANGE -CH CHECKSTANDARDS CHK CIRCLE C COLOR COL, COLOUR COMMANDLINE CLI CONSTRAINTBAR CBAR CONSTRAINTSETTINGS CSETTINGS COPY CO, CP CTABLESTYLE CT CVADD INSERTCONTROLPOINT CVHIDE POINTOFF CVREBUILD REBUILD CVREMOVE REMOVECONTROLPOINT CVSHOW POINTON Copyright Goodheart-Willcox Co., Inc. Appendix D — AutoCAD Command Aliases 2 May not be reproduced or posted to a publicly accessible website. Command Alias CYLINDER CYL DATAEXTRACTION DX DATALINK DL DATALINKUPDATE DLU DBCONNECT DBC, DATABASE, DATASOURCE DDGRIPS GR DELCONSTRAINT DELCON DIMALIGNED DAL, DIMALI DIMANGULAR DAN, DIMANG DIMARC DAR DIMBASELINE DBA, DIMBASE DIMCENTER DCE DIMCONSTRAINT DCON DIMCONTINUE DCO, DIMCONT DIMDIAMETER DDI, DIMDIA DIMDISASSOCIATE DDA DIMEDIT DED, DIMED DIMJOGGED DJO, JOG DIMJOGLINE DJL DIMLINEAR DIMLIN, DLI DIMORDINATE DOR, DIMORD DIMOVERRIDE DOV, DIMOVER DIMRADIUS DIMRAD, DRA DIMREASSOCIATE DRE DIMSTYLE D, DIMSTY, DST DIMTEDIT DIMTED DIST DI, LENGTH DIVIDE DIV DONUT DO DRAWINGRECOVERY DRM DRAWORDER DR Copyright Goodheart-Willcox Co., Inc.
    [Show full text]
  • Shell Scripting with Bash
    Introduction to Shell Scripting with Bash Charles Jahnke Research Computing Services Information Services & Technology Topics for Today ● Introductions ● Basic Terminology ● How to get help ● Command-line vs. Scripting ● Variables ● Handling Arguments ● Standard I/O, Pipes, and Redirection ● Control Structures (loops and If statements) ● SCC Job Submission Example Research Computing Services Research Computing Services (RCS) A group within Information Services & Technology at Boston University provides computing, storage, and visualization resources and services to support research that has specialized or highly intensive computation, storage, bandwidth, or graphics requirements. Three Primary Services: ● Research Computation ● Research Visualization ● Research Consulting and Training Breadth of Research on the Shared Computing Cluster (SCC) Me ● Research Facilitator and Administrator ● Background in biomedical engineering, bioinformatics, and IT systems ● Offices on both CRC and BUMC ○ Most of our staff on the Charles River Campus, some dedicated to BUMC ● Contact: [email protected] You ● Who has experience programming? ● Using Linux? ● Using the Shared Computing Cluster (SCC)? Basic Terminology The Command-line The line on which commands are typed and passed to the shell. Username Hostname Current Directory [username@scc1 ~]$ Prompt Command Line (input) The Shell ● The interface between the user and the operating system ● Program that interprets and executes input ● Provides: ○ Built-in commands ○ Programming control structures ○ Environment
    [Show full text]
  • CS101 Lecture 9
    How do you copy/move/rename/remove files? How do you create a directory ? What is redirection and piping? Readings: See CCSO’s Unix pages and 9-2 cp option file1 file2 First Version cp file1 file2 file3 … dirname Second Version This is one version of the cp command. file2 is created and the contents of file1 are copied into file2. If file2 already exits, it This version copies the files file1, file2, file3,… into the directory will be replaced with a new one. dirname. where option is -i Protects you from overwriting an existing file by asking you for a yes or no before it copies a file with an existing name. -r Can be used to copy directories and all their contents into a new directory 9-3 9-4 cs101 jsmith cs101 jsmith pwd data data mp1 pwd mp1 {FILES: mp1_data.m, mp1.m } {FILES: mp1_data.m, mp1.m } Copy the file named mp1_data.m from the cs101/data Copy the file named mp1_data.m from the cs101/data directory into the pwd. directory into the mp1 directory. > cp ~cs101/data/mp1_data.m . > cp ~cs101/data/mp1_data.m mp1 The (.) dot means “here”, that is, your pwd. 9-5 The (.) dot means “here”, that is, your pwd. 9-6 Example: To create a new directory named “temp” and to copy mv option file1 file2 First Version the contents of an existing directory named mp1 into temp, This is one version of the mv command. file1 is renamed file2. where option is -i Protects you from overwriting an existing file by asking you > cp -r mp1 temp for a yes or no before it copies a file with an existing name.
    [Show full text]
  • Windows Command Prompt Cheatsheet
    Windows Command Prompt Cheatsheet - Command line interface (as opposed to a GUI - graphical user interface) - Used to execute programs - Commands are small programs that do something useful - There are many commands already included with Windows, but we will use a few. - A filepath is where you are in the filesystem • C: is the C drive • C:\user\Documents is the Documents folder • C:\user\Documents\hello.c is a file in the Documents folder Command What it Does Usage dir Displays a list of a folder’s files dir (shows current folder) and subfolders dir myfolder cd Displays the name of the current cd filepath chdir directory or changes the current chdir filepath folder. cd .. (goes one directory up) md Creates a folder (directory) md folder-name mkdir mkdir folder-name rm Deletes a folder (directory) rm folder-name rmdir rmdir folder-name rm /s folder-name rmdir /s folder-name Note: if the folder isn’t empty, you must add the /s. copy Copies a file from one location to copy filepath-from filepath-to another move Moves file from one folder to move folder1\file.txt folder2\ another ren Changes the name of a file ren file1 file2 rename del Deletes one or more files del filename exit Exits batch script or current exit command control echo Used to display a message or to echo message turn off/on messages in batch scripts type Displays contents of a text file type myfile.txt fc Compares two files and displays fc file1 file2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands Source: https://technet.microsoft.com/en-us/library/cc754340.aspx.
    [Show full text]
  • COMMUNICATION STUDIES REGISTRATION INFORMATION DO NOT E-Mail the Professor to Request Permission for Communication Studies Class
    COMMUNICATION STUDIES REGISTRATION INFORMATION DO NOT e-mail the professor to request permission for Communication Studies classes! We follow our departmental waitlist priorities found on the Department web page at: http://www.lsa.umich.edu/comm/undergraduate/generalinformation/majorpolicies. Students on the waitlist are expected to attend the first two lectures and the first discussion section for the class, just as any enrolled student. Students who do not do attend will lose their spot in the class or on the waitlist! ---------------------------------------------------------------------------------------------------------------------- Comm 101 & 102 are restricted to students with freshman and sophomore standing. If you have over 54 credits, including the current semester, you will not be able to register for these. Juniors and seniors wishing to take Comm 101 and 102 may attend the first two lectures and first discussion section of the course and ask the instructor to add them to the waitlist. Instructors will issue permissions from the waitlist after classes begin, according to department waitlist priorities. There may be some exceptions to this policy, but you will need to e-mail [email protected] 2 (TWO) days prior to your registration date to find out if you qualify for an exception. Provide the following: Name: UMID#: Registration Date: Registration Term: Course: Top 3 section choices: Exception eligibility - AP credit has pushed you over the 54 credits for junior standing, OR you have junior standing but have already completed Comm 101 or 102 to start the Comm prerequisites, OR you are a transfer student with junior standing OR you are an MDDP student with more than sophomore standing.
    [Show full text]
  • A Brief Introduction to Unix-2019-AMS
    Brief Intro to Linux/Unix Brief Intro to Unix (contd) A Brief Introduction to o Brief History of Unix o Compilers, Email, Text processing o Basics of a Unix session o Image Processing Linux/Unix – AMS 2019 o The Unix File System Pete Pokrandt o Working with Files and Directories o The vi editor UW-Madison AOS Systems Administrator o Your Environment [email protected] o Common Commands Twitter @PTH1 History of Unix History of Unix History of Unix o Created in 1969 by Kenneth Thompson and Dennis o Today – two main variants, but blended o It’s been around for a long time Ritchie at AT&T o Revised in-house until first public release 1977 o System V (Sun Solaris, SGI, Dec OSF1, AIX, o It was written by computer programmers for o 1977 – UC-Berkeley – Berkeley Software Distribution (BSD) linux) computer programmers o 1983 – Sun Workstations produced a Unix Workstation o BSD (Old SunOS, linux, Mac OSX/MacOS) o Case sensitive, mostly lowercase o AT&T unix -> System V abbreviations 1 Basics of a Unix Login Session Basics of a Unix Login Session Basics of a Unix Login Session o The Shell – the command line interface, o Features provided by the shell o Logging in to a unix session where you enter commands, etc n Create an environment that meets your needs n login: username n Some common shells n Write shell scripts (batch files) n password: tImpAw$ n Define command aliases (this Is my password At work $) Bourne Shell (sh) OR n Manipulate command history IHateHaving2changeMypasswordevery3weeks!!! C Shell (csh) n Automatically complete the command
    [Show full text]
  • “Linux at the Command Line” Don Johnson of BU IS&T  We’Ll Start with a Sign in Sheet
    “Linux at the Command Line” Don Johnson of BU IS&T We’ll start with a sign in sheet. We’ll end with a class evaluation. We’ll cover as much as we can in the time allowed; if we don’t cover everything, you’ll pick it up as you continue working with Linux. This is a hands-on, lab class; ask questions at any time. Commands for you to type are in BOLD The Most Common O/S Used By BU Researchers When Working on a Server or Computer Cluster Linux is a Unix clone begun in 1991 and written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. 64% of the world’s servers run some variant of Unix or Linux. The Android phone and the Kindle run Linux. a set of small Linux is an O/S core programs written by written by Linus Richard Stallman and Torvalds and others others. They are the AND GNU utilities. http://www.gnu.org/ Network: ssh, scp Shells: BASH, TCSH, clear, history, chsh, echo, set, setenv, xargs System Information: w, whoami, man, info, which, free, echo, date, cal, df, free Command Information: man, info Symbols: |, >, >>, <, ;, ~, ., .. Filters: grep, egrep, more, less, head, tail Hotkeys: <ctrl><c>, <ctrl><d> File System: ls, mkdir, cd, pwd, mv, touch, file, find, diff, cmp, du, chmod, find File Editors: gedit, nedit You need a “xterm” emulation – software that emulates an “X” terminal and that connects using the “SSH” Secure Shell protocol. ◦ Windows Use StarNet “X-Win32:” http://www.bu.edu/tech/support/desktop/ distribution/xwindows/xwin32/ ◦ Mac OS X “Terminal” is already installed Why? Darwin, the system on which Apple's Mac OS X is built, is a derivative of 4.4BSD-Lite2 and FreeBSD.
    [Show full text]
  • The Linux Command Line
    The Linux Command Line Fifth Internet Edition William Shotts A LinuxCommand.org Book Copyright ©2008-2019, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042. A version of this book is also available in printed form, published by No Starch Press. Copies may be purchased wherever fine books are sold. No Starch Press also offers elec- tronic formats for popular e-readers. They can be reached at: https://www.nostarch.com. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. Release History Version Date Description 19.01A January 28, 2019 Fifth Internet Edition (Corrected TOC) 19.01 January 17, 2019 Fifth Internet Edition. 17.10 October 19, 2017 Fourth Internet Edition. 16.07 July 28, 2016 Third Internet Edition. 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. Table of Contents Introduction....................................................................................................xvi Why Use the Command Line?......................................................................................xvi
    [Show full text]
  • Red Hat Jboss Data Grid 7.2 Data Grid for Openshift
    Red Hat JBoss Data Grid 7.2 Data Grid for OpenShift Developing and deploying Red Hat JBoss Data Grid for OpenShift Last Updated: 2019-06-10 Red Hat JBoss Data Grid 7.2 Data Grid for OpenShift Developing and deploying Red Hat JBoss Data Grid for OpenShift Legal Notice Copyright © 2019 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries. Node.js ® is an official trademark of Joyent.
    [Show full text]
  • Shell Variables
    Shell Using the command line Orna Agmon ladypine at vipe.technion.ac.il Haifux Shell – p. 1/55 TOC Various shells Customizing the shell getting help and information Combining simple and useful commands output redirection lists of commands job control environment variables Remote shell textual editors textual clients references Shell – p. 2/55 What is the shell? The shell is the wrapper around the system: a communication means between the user and the system The shell is the manner in which the user can interact with the system through the terminal. The shell is also a script interpreter. The simplest script is a bunch of shell commands. Shell scripts are used in order to boot the system. The user can also write and execute shell scripts. Shell – p. 3/55 Shell - which shell? There are several kinds of shells. For example, bash (Bourne Again Shell), csh, tcsh, zsh, ksh (Korn Shell). The most important shell is bash, since it is available on almost every free Unix system. The Linux system scripts use bash. The default shell for the user is set in the /etc/passwd file. Here is a line out of this file for example: dana:x:500:500:Dana,,,:/home/dana:/bin/bash This line means that user dana uses bash (located on the system at /bin/bash) as her default shell. Shell – p. 4/55 Starting to work in another shell If Dana wishes to temporarily use another shell, she can simply call this shell from the command line: [dana@granada ˜]$ bash dana@granada:˜$ #In bash now dana@granada:˜$ exit [dana@granada ˜]$ bash dana@granada:˜$ #In bash now, going to hit ctrl D dana@granada:˜$ exit [dana@granada ˜]$ #In original shell now Shell – p.
    [Show full text]