LINUX - Arizona State University

2y ago
65 Views
2 Downloads
220.29 KB
14 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Jacoby Zeller
Transcription

LINUXA QUICK INTRODUCTION

The Unix System Unix is case sensitive Unix users do not use spaces in filenames Most of the work is done from the shell Shell acts as interface between user and system Bourne shell is the shell used in Unixecho shell/bin/bash

Login An account, username and password is required to login to a system. Remote login requires Secure SHell : remote login program Allows you to log on to a remote machine SSH ensures secure, encrypted communicationSyntaxssh username@hostnameorssh -l username hostname

Files and Directoriescd directorychange to directory directorypwdshow absolute path of current directorylsshow all files in current directoryls -a directoryshow all files in directory directory (including filenames starting with .)ls -lshow all files in current directory (detailed file information)cat fileprint content of file file to STDOUTmore filepage through file file one screenful at a timeless filelike more, but more user friendlycat f1 f2 f3write content of file f1 and f2 to file f3cat f1 f2append content of file f1 to the end of file f2cp f1 f2copy file1 to file2 (rename f1 as f2)cp f1 f2 directorycopy files f1 and f2 into directory directorymv f1 f2rename file f1 as file f2mv f1 dirmove file f1 to directory dirmkdir directorymake (create) directory directoryrm fileremove file filermdir directoryremove directoryrm -r dirremove directory dir and all files/directory in dirtext-editor-name fileopen file file in text editor*Text Editors – vi, gedit (has a GUI), emacs, xemacs, pico, nano

File System PermissionsFile system permissions under UNIX/Linux:Øfiles/directories are owned by a user who belongs to a specific groupØpermission to read/write/execute can be defined independently for specific users and groupsØto start/delete a file you need write/execute permission for the directoryØto list the content of a directory (ls), you need the permission to rectory

File System Permissionsls -l fileshow detailed file info for file filellsame as ls -lchmod u x fileset permission to execute file for user(means user is allowed to execute file)chmod o r fileset reading permission for other(means file can be read by all users)chmod g w fileset writing permission for groupchmod 754 fileuser is allowed to read/write/execute filegroup is allowed to read/execute fileother is allowed to read filechown user filechange owner of file to usere.g. chown math file file is owned by math nowchown user filechange group of file to group

More useful Commandswhoshow who is currently logged in to the systemwhich commandshow path for a (shell) commandlocate patternfind all files in a database which match the patternman commandshow manpages (manual) for a commandcommand - -helpshow help for commandcommand -hsame as command - -helphead fileprint first 10 lines of file file to STDOUThead -100 fileprint first 100 lines of file file to STDOUTtail fileprint last 10 lines of file file to STDOUTtail -50 fileprint last 50 lines of file file to STDOUTcat fileprint content of file to STDOUTdfprint available and used disk space usage of file systemduprint estimate of file space usage

WildcardsAsterisk *matches any number of characters, including noneSquare brackets [3-9]any number between 3 and 9Square brackets [c-f]c, d, e or fls *.txtlist all file names ending with .txtmv handout* WS09move all files starting with “handout” to directory WS09rm chapter[2-5]delete chapter2, chapter3, chapter4, chapter5ls *.[pt][dx][ft]list all files ending with .pdf and .txtcp *.htm* directorycopy all files ending with .htm, followed by any number of characters, includingnone, to directory e.g. file.htm, file.html cp *.htm? directory copy all files endingwithcp *.htm? directorycopy all files ending with .htm, followed by exactly one character, to directoryfile.html (but NOT file.htm)

Grepgrep pattern fileprints all lines in file matching a particular search patterngrep crisis fileprints all lines in file containing “crisis”grep -v crisis fileprints all lines in file NOT containing “crisis”grep -o crisis fileshow only the part of the line that matches “crisis”grep [Mm]inister[Ii]*n* fileshow all lines containing the masculine or feminine form of “Minister”, andall compound words with “minister”grep -n pattern fileinclude line numbersgrep - -color pattern filehighlighting of search patterngrep pattern file wc -lshows number of lines containing search pattern (How often occurs patternin file?)

Findfind . -name filenamefind a file by name (case - sensitive)find /directory -name filenamefind file filename under the directory directoryfind . -name ‘filena’find file with partial filenamefind -iname ‘*.tex’find a file by name ignoring the case ( used for including hiddenfiles)find -size 50Mfind all files greater than 50MBfind -size -100Mfind all the files less than 100MBfind . –type f –name “*.py”find all the files with ending .pyfind /home -user mathfind file owned by a particular user

File TransferWhile working on a remote system use the following for file transfer:sftpsftp –p port username@hostscpscp username@remotehost.edu: foobar.txt /some/local/directoryrsyncrsync options source destinationssh with remote displaySsh – X or ssh –Y (XII forwarding)

Compressing/Archiving Filesfile endingstar.gz, tgz, zip, gz, bz, rar, bz2, .gzip filecompress a file using gunzipgunzip file.gzuncompress a gunzip filetar -cf archive.tar f1 f2 f3create archive archive.tar and add files f1, f2, f3 to archive filetar -czf archive.tgz f1 f2 f3like tar -cf, additionally compress archive using gunziptar -xzf archive.tgzdecompress archive.tgz and write files to current directorytar jxf archive.bz2unpack .bz2 filetar jcf archive.bz2 f1 f2 f3create .bz2 archive filezip zipped.zip f1 f2 f3create .zip compressed filesunzip zipped.zipunzip a .zip file

Job Controljobslist all jobs (running processes)jobs -ljobs with job idpsshow all running jobskillsend signal to jobkill -llists all possible signalskill -9 PIDsend signal SIGKILL (terminate process) to job with id PID STRG -cterminate current job STRG -zsuspend current jobbgresume suspended job in the backgroundbg job numberresume job with job number in the backgroundfg job numberresume job with job number in the foregroundcommand &start command in the backgroundpipe ( ) commandssend the output of one program to another program for further processing.cat filename lessdisplay the contents of file filename one screenful at a a time using lesstopshow the current processes on the system./a.outexecute command for current directory

Useful LinksLinux Shell Scripting Tutorial v1.05r3A Beginner’s handbookhttp://www.freeos.com/guides/lsstThe Linux Cookbook: Tips and Techniques for Everyday Usehttp://dsl.org/cookbook/cookbook toc.htmlAnalyzing Texthttp://dsl.org/cookbook/cookbook 16.htmlIntroduction to Linux – A Hands on Guidetldp.org/LDP/intro-linux/intro-linux.pdf

File system permissions under UNIX/Linux: . bg job number resume job with job number in the background fg job number resume job with job number in the foreground command & start command in the backgroun

Related Documents:

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 .

Other Linux resources from O’Reilly Related titles Building Embedded Linux Systems Linux Device Drivers Linux in a Nutshell Linux Pocket Guide Running Linux Understanding Linux Network Internals Understanding the Linux Kernel Linux Books Resource Center linu

201 E. Orchid Lane 3030 S. Donald Ave. 1521 W. Vernon Box L31 6)36 W. Aie1ia Ave. )4836 S. Tenth St. Phoenix, Arizona Phoenix, Arizona Prescott, Arizona Tempe, Arizona Tucson, Arizona Phoenix, Arizona Sedona, Arizona Phoenix, Arizona Phoenix, Arizona Tucson, Arizona 85021 85020 8571b 85007 86336 85033 85OL0 Eugene Zerby 1520 E. Waverly S

Perfection PC Perfection PC Inc. Philips Philips Electronics Planar Planar Systems Inc PLEXON Plexon, Inc. Pogo Linux Pogo Linux, Inc. Pogo Linux Altura M2 Pogo Linux, Inc. Pogo Linux Velocity -D50 Pogo Linux, Inc. Pogo Linux Verona 330 Pogo Linux, Inc. Pogo Linux Vor

Yes. Oracle Autonomous Linux, which is based on Oracle Linux, is 100% application binary compatible with IBM's Red Hat Enterprise Linux. This means that applications certified to run on Red Hat Enterprise Linux can run on Oracle Autonomous Linux unmodified. Oracle Linux binaries are provided for patching and updating Red Hat Enterprise Linux

Official Kali Linux Documentation This PDF has been autogenerated on docs.kali.org - Apr 7, 2013 00. Introduction to Kali Linux What is Kali Linux ? Kali Linux is an advanced Penetration Testing and Security Auditing Linux distribution. Kali Linux Features Kali is a complete re-build of BackTrack Linux, adhering completely to Debian development .

2 LXC DOCKER MICHAEL LESSARD A bit of history - Virtualization and containers Chroot (version 7 Unix, 1979) FreeBSD Jails (FreeBSD 4, 2000) Linux vserver (Linux, Oct 2001) Para-virtualization Xen (Linux, 2003) Solaris zones (Solaris 10, 2004) OpenVZ (Linux, 2005) Full virtualization KVM (Linux, 2007) Linux Containers - LXC (Linux 2.6.29 2009)

078723201 arizona call-a-teen center for excellence 078924001: arizona charter academy 110422105 arizona city elementary school 108909001: arizona college prep academy 070280243 arizona college prep erie campus 070280145: arizona college prep oakland campus 108507001 arizona collegiate high school 078971001: arizona conservatory for arts and .