"Linux At The Command Line" - Boston University

1y ago
19 Views
2 Downloads
4.42 MB
30 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Javier Atchley
Transcription

“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 timeallowed; if we don’t cover everything, you’llpick it up as you continue working withLinux.This is a hands-on, lab class; ask questionsat any time.Commands for you to type are in BOLD

The MostCommon O/SUsed By BUResearchers WhenWorking on aServer orComputer Cluster

Linux is a Unix clone begun in 1991 andwritten from scratch by Linus Torvalds withassistance from a loosely-knit team ofhackers across the Net.64% of the world’s servers run some variantof Unix or Linux. The Android phone and theKindle run Linux.

Linux is an O/S corewritten by LinusTorvalds and othersANDa set of smallprograms written byRichard Stallman andothers. They are theGNU utilities.http://www.gnu.org/

Network: ssh, scpShells: BASH, TCSH, clear, history, chsh, echo,set, setenv, xargsSystem Information: w, whoami, man, info,which, free, echo, date, cal, df, freeCommand Information: man, infoSymbols: , , , , ;, , ., .Filters: grep, egrep, more, less, head, tailHotkeys: ctrl c , ctrl d File System: ls, mkdir, cd, pwd, mv, touch, file,find, diff, cmp, du, chmod, findFile 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 op/distribution/xwindows/xwin32/

Mac OS X “Terminal” is already installed Why? Darwin, the system on which Apple's Mac OS Xis built, is a derivative of 4.4BSD-Lite2 and FreeBSD.In other words, the Mac is a Unix system!

Your Instructor TodayThe Ideal Lab Facility

X-Win32/X-Config Wizard Name: scc1 Type: ssh Host: scc1.bu.edu (Off-campus, must include domain“bu.edu” ) Login: userID Password: password Command: Linux Click “scc1” then “Launch” Accept the host server public key (first time only)

Terminal Type ssh –Y scc1.bu.edu (less secure)

From the lab computer Using File Explorer, copy the directory “\\scvfiles.bu.edu\SCV\Training\2013 falltutorials\linux class” to “My Documents” on yourlab machineLinux Connect to scc1.bu.edu using X-Win32 and runthis command: cp -Rv /project/earth/linux class /From a browser, download:http://ssrc.bu.edu/linux class

A shell is a computer program that interprets thecommands you type and sends them to the operatingsystem. Secondly, it provide a programming environmentconsisting of environment variables.Most BU systems, including the BU Linux Cluster, supportat least two shells: TCSH and BASH. The default shell foryour account is TCSH. The most popular and powerfulLinux shell today is BASH.To determine your shell type: echo SHELL (shell prints contents of env echo “ SHELL” (shell still processes env. variable) echo ‘ SHELL’ (shell treats env. variable as simple literal) The complete environment can be printed with set, setenv(TCSH) and set (BASH).To determine the path to the shell program, type: which bash which tcsh Change the shell with “chsh /bin/bash” (provide path tonew shell as a “parameter,” meaning to be explained soon)

The ShellOutput of the echo, which and chsh commands

After you connect, type shazamwhoamihostnamedatecalfreeCommands have three parts; command, options andparameters. Example: cal –j 3 1999. “cal” is the command,“-j” is an option (or switch), “3” and “1999” are parameters.Options have long and short forms. Example: date –u data --universalWhat is the nature of the prompt?What was the system’s response to the command?

System InformationOutput of the whoami, hostname, date, cal and free

Try the history commandTry Ctrl r (only works in BASH shell)Choose from the command history by usingthe up and down arrowsWhat do the left and right arrow do onthe command line?Try the Del and Backspace keys

Type hostname –-help man hostname info hostname (gives the same or most information,but must be paged) And “Yes,” you can always Google it

The pipe “ ” feeds the OUTPUT of onecommand into the INPUT of another command.Our first example will use the pipe symbol tofilter the output of a command. Try: w w grep ‘root’ ps -e -o ruser,comm grep 'tut‘ The ps command is using both “options (dash)”and parametersTry both “man grep” and “info grep”. See thedifference?

The structure resembles an upside down treeDirectories are collections of files and otherdirectories.Every directory has a parent except for theroot directory.Many directories have children directories.Unlike Windows, with multiple drives andmultiple file systems, a *Nix system only hasONE file system.

The Linux File SystemA Typical Linux File System

Trytree –L 3 –d / lesstree –L 3 / lessfile /bin/alsac then press tab cd ; pwd (This is your home directory whereapplication settings are kept and where you havewrite privileges) ls mkdir myPics;mkdir myPics/work;mkdirmyPics/friends;mkdir myPics/friends/BU; mkdirmyPics/friends/MIT tree myPics

Examining the File SystemOutput from the tree, file, pwd and ls commandsDemonstration of using the mkdir command

There are two types of pathnames Absolute (Abs) – the full path to a directory or file;begins with the root symbol / Relative (Rel) – a partial path that is relative to thecurrent working directory Examples Abs cd /usr/local/lib echo HOME (one of may environment variablesmaintained by the shell) Abs cd echo HOME pwd Rel cd . Rel cd . Abs cd /lib (location OS shared libraries) ls –d */ (a listing of only the directories in /lib)

Navigating the File SystemMoving around the file system using the cd command

More useful commands cd (also takes you to your home directory like cd )mkdir testecho ‘Hello everyone’ test/myfile.txtecho ‘Goodbye all’ test/myfile.txtless test/myfile.txtmkdir test/subdir1/subdir2 (FAILS)mkdir -p test/subdir1/subdir2 (Succeeds)mv test/myfile.txt test/subdir1/subdir2rmdir test (FAILS)rm –Rv test (Succeeds)

Modifying the Linux File SystemDemonstration of the mkdir, less, mv, rmdir and rm commands

Useful options for the “ls” command: ls -a List all file including hidden file beginning witha period “.” ls -ld */ List details about a directory and not itscontents ls -F Put an indicator character at the end of eachname ls –l Simple long listing ls –lh Give human readable file sizes ls –lS Sort files by file size ls –lt Sort files by modification time

EmacsVimNeditGeditEmacs and Vim are powerful editors used bymost programmers. Nedit and Gedit and easyto learn editors useful for new users on aLinux system.

command into the INPUT of another command. Our first example will use the pipe symbol to filter the output of a command. Try: w w grep 'root' ps -e -o ruser,comm grep 'tut' The ps command is using both "options (dash)" and parameters Try both " man grep" and " info grep". See the difference?

Related Documents:

May 02, 2018 · D. Program Evaluation ͟The organization has provided a description of the framework for how each program will be evaluated. The framework should include all the elements below: ͟The evaluation methods are cost-effective for the organization ͟Quantitative and qualitative data is being collected (at Basics tier, data collection must have begun)

Silat is a combative art of self-defense and survival rooted from Matay archipelago. It was traced at thé early of Langkasuka Kingdom (2nd century CE) till thé reign of Melaka (Malaysia) Sultanate era (13th century). Silat has now evolved to become part of social culture and tradition with thé appearance of a fine physical and spiritual .

On an exceptional basis, Member States may request UNESCO to provide thé candidates with access to thé platform so they can complète thé form by themselves. Thèse requests must be addressed to esd rize unesco. or by 15 A ril 2021 UNESCO will provide thé nomineewith accessto thé platform via their émail address.

̶The leading indicator of employee engagement is based on the quality of the relationship between employee and supervisor Empower your managers! ̶Help them understand the impact on the organization ̶Share important changes, plan options, tasks, and deadlines ̶Provide key messages and talking points ̶Prepare them to answer employee questions

Dr. Sunita Bharatwal** Dr. Pawan Garga*** Abstract Customer satisfaction is derived from thè functionalities and values, a product or Service can provide. The current study aims to segregate thè dimensions of ordine Service quality and gather insights on its impact on web shopping. The trends of purchases have

Linux in a Nutshell Linux Network Administrator’s Guide Linux Pocket Guide Linux Security Cookbook Linux Server Hacks Linux Server Security Running Linux SELinux Understanding Linux Network Internals Linux Books Resource Center linux.oreilly.comis a complete catalog of O’Reilly’s books on Linux and Unix and related technologies .

Command Library - String Operation Command Command Library - XML Command Command Library - Terminal Emulator Command (Per Customer Interest) Command Library - PDF Integration Command Command Library - FTP Command (Per Customer Interest) Command Library - PGP Command Command Library - Object Cloning

expand your Linux knowledge or to research solutions to a specific problem you are trying to solve. The Linux Console Every component installed on NI Linux Real-Time can be controlled via the Linux command line. The command line interpreter looks very similar to the Windows command prompt (see Figure 1). In Linux, these command line inter-