SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
Unix Commands
                                                   Unix                                                                 January 2003

This quick reference lists commands, including a syntax diagram      2. Commands
and brief description. […] indicates an optional part of the         2.1. Command-line Special Characters
command. For more detail, use:
                                                                         Quotes and Escape
   man command                                                       Join Words                                                 "…"
Use man tcsh for the command language.                               Suppress Filename, Variable Substitution                   '…'
                                                                     Escape Character                                             
1. Files
                                                                       Separation, Continuation
1.1. Filename Substitution                                           Command Separation                                            ;
Wild Cards                                                 ? *       Command-Line Continuation (at end of line)                    
Character Class (c is any single character)              [c…]
   Range                                                 [c-c]       2.2. I/O Redirection and Pipes
Home Directory                                                ~      Standard Output                                              >
Home Directory of Another User                            ~user          (overwrite if exists)                                  >!
List Files in Current Directory                        ls [-l]       Appending to Standard Output                               >>
List Hidden Files                                     ls -[l]a       Standard Input                                               <
                                                                     Standard Error and Output                                  >&
1.2. File Manipulation                                               Standard Error Separately
Display File Contents                          cat filename                                    ( command > output ) >& errorfile
Copy                                   cp source destination         Pipes/ Pipelines                   command | filter [ | filter]
Move (Rename)                          mv oldname newname               Filters
Remove (Delete)                                 rm filename          Word/Line Count                                         wc [-l]
Create or Modify file                        pico filename           Last n Lines                                         tail [-n]
                                                                     Sort lines                                           sort [-n]
1.3. File Properties
                                                                     Multicolumn Output                                       pr -t
Seeing Permissions                                ls -l filename     List Spelling Errors                                   ispell
Changing Permissions                      chmod nnn filename
                                chmod c=p…[,c=p…] filename           2.3. Searching with grep
   n, a digit from 0 to 7, sets the access level for the user        grep Command                       grep "pattern" filename
   (owner), group, and others (public), respectively. c is one of:                                    command | grep "pattern"
   u–user; g–group, o–others, or a–all. p is one of: r–read             Search Patterns
   access, w–write access, or x–execute access.                            beginning of line                                     ^
Setting Default Permissions                            umask ugo           end of line                                           $
   ugo is a (3-digit) number. Each digit restricts the default             any single character                                  .
   permissions for the user, group, and others, respectively.              single character in list or range                   […]
Changing Modification Time                     touch filename              character not in list or range                     [^…]
Making Links                        ln [-s] oldname newname                zero or more of preceding char. or pattern            *
Seeing File Types                                           ls -F          zero or more of any character                        .*
1.4. Displaying a File with less                                           escapes special meaning                               

Run less                                       less filename
                                                                     3. C-Shell Features.
  Next line                                               RETURN
  Next Page                                                SPACE
                                                                     3.1 History Substitution
  Previous line                                                k     Repeat Previous Command                                      !!
  Previous Page                                                b     Commands Beginning with str                                !str
                                                                     Commands Containing str                                 !?str[?]
1.5. Directories                                                     All Arguments to Prev. Command                               !*
Change Directory                                 cd directory
                                                                         Word Designators
Make New Directory                            mkdir directory        All Arguments                                                :*
Remove Directory                              rmdir directory        Last Argument                                                :$
Print Working (Show Current) Directory                   pwd         First Argument                                               :^
                                                                     n'th Argument                                                :n
Arguments x Through y                                      :x-y      Standard Commands                               whereis file
    Modifiers                                                        Aliases and Commands                          which command
Print Command Line                                          :p       Describe Command                             whatis command
Substitute Command Line                             :[g]s/l/r/       Searching Out Files          find dir -name name -print
                                                                        dir is a directory name within which to search.
3.2 Aliases                                                             name is a filename to search for.
alias Command                     alias name 'definition'
                                                                     6.2. Finding Changes
   definition can contain escaped history substitution event
and                                                                  Comparing Files                              diff leftfile rightfile
word designators as placeholders for command-line arguments.           diff prefixes a less-than (<) to selected lines from leftfile
                                                                       and a greater-than (>) to lines from rightfile.
3.3. Variable Substitution
Creating a Variable                                     set var      6.3. Automating Tasks
Assigning a Value                              set var = value       Create a Makefile                           pico Makefile
Expressing a Value                                            $var      A makefile consists of macro definitions and targets.
Displaying a Value                                   echo $var       Test Makefile                               make -n [target]
   value is a single word, an expression in quotes, or an            Run make                                        make [target]
   expression that results in a single word after variable,
                                                                     6.4. Managing Disk Usage
   filename and command substitution takes place.
Assigning a List                                set var = (list)     Check Quota                                             quota -v
   list is a space-separated list of words, or an expression that    Seeing Disk Usage                                             df
   results in a space-separated list.                                                                                           du -s
Selecting the n'th Item                                   $var[n]
                                                                     6.5. Combining and Compressing Files
Selecting all Items                                          $var
Selecting a Range                                       $var[x-y]    Create a tarfile         tar cf file.tar file1 file2 … fileN
Item Count                                                  $#var       tar combines files but does not compress
                                                                     Create a zipfile                              zip filename
3.4 foreach Lists                                                    Unzip a file                                unzip filename
Start foreach Loop                         foreach var (list)
   foreach prompts for commands to repeat for each item in           7. Printing
   list (with >), until you type end. Within   the loop, $var        7.1 Formatting Output for Printing
   stands for the current item in list.                              Paginate with Page Headers                          pr filename
                                                                        in n columns                                  pr -n filename
3.5. Command Substitution
                                                                     Format for Laser Printer                          tex document
Replace Command with its Output on Command Line            `…`
                                                                     7.2 The Printer Queue
3.6 Job Control
                                                                     Print a File                                lp [-dpr] filename
Run Command in the Background                                  &                                                    lpcae filename
Stop Foreground Job                                       CTRL-Z     Check Quota                                           lpquot
List of Background Jobs                                    jobs      List Queue                                                 lpq
Bring Job Forward                                            %[n]    Stop Job                                                  lprm
Resume Job in Background                                  %[n] &
                                                                     8. Miscellaneous
4. Processes
                                                                     8.1 Miscellaneous Commands
Listing                                            ps [-[ef]]
Terminating                                     kill [-9] PID        List Commands for Subject                        man -k subject
Timing                                            time command       Display Current Date and Time                            date
   time is a number up to 4 digits. script is the name   of a file   Log off                                                  exit
   containing the command line(s) to perform.                        Electronic Mail                                          pine
                                                                     Display Documentation                             man command
5. Users
                                                                     8.2 Control Keys
Seeing Who is Logged In                                   who
                                                                     Abort Program                                                CTRL-C
                                                            w
                                                                     Backspace (Delete Last Character)                            CTRL-H
Seeing Your User Name                                  whoami        Pause Display on Screen                                      CTRL-S
                                                                     Resume Display after CTRL-S                                  CTRL-Q
6. Managing Files                                                    Send Job to Background                      CTRL-Z   followed by bg
6.1. Looking Up Files
Is this document clear? Is it missing crucial information?
   Please mail comments to the handout editor, CAE,
 1410 Engineering Drive, or to: editor@engr.wisc.edu

Contenu connexe

Tendances (14)

Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Unix cmd
Unix cmdUnix cmd
Unix cmd
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Os lab manual
Os lab manualOs lab manual
Os lab manual
 
Rf介绍
Rf介绍Rf介绍
Rf介绍
 
Commands
CommandsCommands
Commands
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic Commands
 
101 3.1 gnu and unix commands
101 3.1 gnu and unix commands101 3.1 gnu and unix commands
101 3.1 gnu and unix commands
 

En vedette

Linux Command Line Basics
Linux Command Line BasicsLinux Command Line Basics
Linux Command Line BasicsWe Ihaveapc
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumarymentorsnet
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT studentsPartnered Health
 
Unix command line concepts
Unix command line conceptsUnix command line concepts
Unix command line conceptsArtem Nagornyi
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testingGaruda Trainings
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line toolsEric Wilson
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014iimjobs and hirist
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 

En vedette (16)

Unix short
Unix shortUnix short
Unix short
 
Linux Command Line Basics
Linux Command Line BasicsLinux Command Line Basics
Linux Command Line Basics
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
 
Java Notes
Java NotesJava Notes
Java Notes
 
Unix command line concepts
Unix command line conceptsUnix command line concepts
Unix command line concepts
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line tools
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 

Similaire à Unix

Lecture1 3 shells
Lecture1 3 shellsLecture1 3 shells
Lecture1 3 shellsnghoanganh
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent cardBui Van Cuong
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetlinkedinstaging
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetlinkedinstaging
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetlinkedinstaging
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
Quick guide of the most common linux commands
Quick guide of the most common linux commandsQuick guide of the most common linux commands
Quick guide of the most common linux commandsCarlos Enrique
 
Unix Trainning Doc.pptx
Unix Trainning Doc.pptxUnix Trainning Doc.pptx
Unix Trainning Doc.pptxKalpeshRaut7
 
Kali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdfKali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdfSN 600W
 
List command linux a z
List command linux a zList command linux a z
List command linux a zJinyuan Loh
 
An a z index of the bash commands
An a z index of the bash commandsAn a z index of the bash commands
An a z index of the bash commandsBen Pope
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 

Similaire à Unix (20)

Lecture1 3 shells
Lecture1 3 shellsLecture1 3 shells
Lecture1 3 shells
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheet
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheet
 
gnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheetgnu-coreutils-cheat-sheet
gnu-coreutils-cheat-sheet
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Quick guide of the most common linux commands
Quick guide of the most common linux commandsQuick guide of the most common linux commands
Quick guide of the most common linux commands
 
archive A-Z linux
archive A-Z linuxarchive A-Z linux
archive A-Z linux
 
Unix Trainning Doc.pptx
Unix Trainning Doc.pptxUnix Trainning Doc.pptx
Unix Trainning Doc.pptx
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Kali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdfKali Linux Commands PDF-converted.pdf
Kali Linux Commands PDF-converted.pdf
 
Kali linux commands
Kali linux commandsKali linux commands
Kali linux commands
 
List command linux a z
List command linux a zList command linux a z
List command linux a z
 
Unix
UnixUnix
Unix
 
An a z index of the bash commands
An a z index of the bash commandsAn a z index of the bash commands
An a z index of the bash commands
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 

Plus de Srinath Dhayalamoorthy

இசை கருவிகளின் வகைகள் Spring instruments
இசை கருவிகளின் வகைகள்   Spring instrumentsஇசை கருவிகளின் வகைகள்   Spring instruments
இசை கருவிகளின் வகைகள் Spring instrumentsSrinath Dhayalamoorthy
 
இசை கருவிகளின் வகைகள் - Wind instruments
இசை கருவிகளின் வகைகள் - Wind instrumentsஇசை கருவிகளின் வகைகள் - Wind instruments
இசை கருவிகளின் வகைகள் - Wind instrumentsSrinath Dhayalamoorthy
 
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்Srinath Dhayalamoorthy
 
IPC Section Part - 2 | Import Insurance to know | Offence and Punishment
IPC Section Part - 2 | Import Insurance to know | Offence and PunishmentIPC Section Part - 2 | Import Insurance to know | Offence and Punishment
IPC Section Part - 2 | Import Insurance to know | Offence and PunishmentSrinath Dhayalamoorthy
 
Fields of digital image processing slides
Fields of digital image processing slidesFields of digital image processing slides
Fields of digital image processing slidesSrinath Dhayalamoorthy
 

Plus de Srinath Dhayalamoorthy (11)

இசை கருவிகளின் வகைகள் Spring instruments
இசை கருவிகளின் வகைகள்   Spring instrumentsஇசை கருவிகளின் வகைகள்   Spring instruments
இசை கருவிகளின் வகைகள் Spring instruments
 
இசை கருவிகளின் வகைகள் - Wind instruments
இசை கருவிகளின் வகைகள் - Wind instrumentsஇசை கருவிகளின் வகைகள் - Wind instruments
இசை கருவிகளின் வகைகள் - Wind instruments
 
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்
இசை கருவிகளின் வகைகள் - தோலிசைக் கருவிகள்
 
Best weapon to tackle covid 19
Best weapon to tackle covid 19Best weapon to tackle covid 19
Best weapon to tackle covid 19
 
How coronavirus spread in the World?
How coronavirus spread in the World? How coronavirus spread in the World?
How coronavirus spread in the World?
 
IPC Section Part - 2 | Import Insurance to know | Offence and Punishment
IPC Section Part - 2 | Import Insurance to know | Offence and PunishmentIPC Section Part - 2 | Import Insurance to know | Offence and Punishment
IPC Section Part - 2 | Import Insurance to know | Offence and Punishment
 
IPC sections | Indian Sarais Act 1887
IPC sections | Indian Sarais Act 1887IPC sections | Indian Sarais Act 1887
IPC sections | Indian Sarais Act 1887
 
Fields of digital image processing slides
Fields of digital image processing slidesFields of digital image processing slides
Fields of digital image processing slides
 
Inheritance
InheritanceInheritance
Inheritance
 
Java applets
Java appletsJava applets
Java applets
 
Servers
ServersServers
Servers
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Unix

  • 1. Unix Commands Unix January 2003 This quick reference lists commands, including a syntax diagram 2. Commands and brief description. […] indicates an optional part of the 2.1. Command-line Special Characters command. For more detail, use: Quotes and Escape man command Join Words "…" Use man tcsh for the command language. Suppress Filename, Variable Substitution '…' Escape Character 1. Files Separation, Continuation 1.1. Filename Substitution Command Separation ; Wild Cards ? * Command-Line Continuation (at end of line) Character Class (c is any single character) [c…] Range [c-c] 2.2. I/O Redirection and Pipes Home Directory ~ Standard Output > Home Directory of Another User ~user (overwrite if exists) >! List Files in Current Directory ls [-l] Appending to Standard Output >> List Hidden Files ls -[l]a Standard Input < Standard Error and Output >& 1.2. File Manipulation Standard Error Separately Display File Contents cat filename ( command > output ) >& errorfile Copy cp source destination Pipes/ Pipelines command | filter [ | filter] Move (Rename) mv oldname newname Filters Remove (Delete) rm filename Word/Line Count wc [-l] Create or Modify file pico filename Last n Lines tail [-n] Sort lines sort [-n] 1.3. File Properties Multicolumn Output pr -t Seeing Permissions ls -l filename List Spelling Errors ispell Changing Permissions chmod nnn filename chmod c=p…[,c=p…] filename 2.3. Searching with grep n, a digit from 0 to 7, sets the access level for the user grep Command grep "pattern" filename (owner), group, and others (public), respectively. c is one of: command | grep "pattern" u–user; g–group, o–others, or a–all. p is one of: r–read Search Patterns access, w–write access, or x–execute access. beginning of line ^ Setting Default Permissions umask ugo end of line $ ugo is a (3-digit) number. Each digit restricts the default any single character . permissions for the user, group, and others, respectively. single character in list or range […] Changing Modification Time touch filename character not in list or range [^…] Making Links ln [-s] oldname newname zero or more of preceding char. or pattern * Seeing File Types ls -F zero or more of any character .* 1.4. Displaying a File with less escapes special meaning Run less less filename 3. C-Shell Features. Next line RETURN Next Page SPACE 3.1 History Substitution Previous line k Repeat Previous Command !! Previous Page b Commands Beginning with str !str Commands Containing str !?str[?] 1.5. Directories All Arguments to Prev. Command !* Change Directory cd directory Word Designators Make New Directory mkdir directory All Arguments :* Remove Directory rmdir directory Last Argument :$ Print Working (Show Current) Directory pwd First Argument :^ n'th Argument :n
  • 2. Arguments x Through y :x-y Standard Commands whereis file Modifiers Aliases and Commands which command Print Command Line :p Describe Command whatis command Substitute Command Line :[g]s/l/r/ Searching Out Files find dir -name name -print dir is a directory name within which to search. 3.2 Aliases name is a filename to search for. alias Command alias name 'definition' 6.2. Finding Changes definition can contain escaped history substitution event and Comparing Files diff leftfile rightfile word designators as placeholders for command-line arguments. diff prefixes a less-than (<) to selected lines from leftfile and a greater-than (>) to lines from rightfile. 3.3. Variable Substitution Creating a Variable set var 6.3. Automating Tasks Assigning a Value set var = value Create a Makefile pico Makefile Expressing a Value $var A makefile consists of macro definitions and targets. Displaying a Value echo $var Test Makefile make -n [target] value is a single word, an expression in quotes, or an Run make make [target] expression that results in a single word after variable, 6.4. Managing Disk Usage filename and command substitution takes place. Assigning a List set var = (list) Check Quota quota -v list is a space-separated list of words, or an expression that Seeing Disk Usage df results in a space-separated list. du -s Selecting the n'th Item $var[n] 6.5. Combining and Compressing Files Selecting all Items $var Selecting a Range $var[x-y] Create a tarfile tar cf file.tar file1 file2 … fileN Item Count $#var tar combines files but does not compress Create a zipfile zip filename 3.4 foreach Lists Unzip a file unzip filename Start foreach Loop foreach var (list) foreach prompts for commands to repeat for each item in 7. Printing list (with >), until you type end. Within the loop, $var 7.1 Formatting Output for Printing stands for the current item in list. Paginate with Page Headers pr filename in n columns pr -n filename 3.5. Command Substitution Format for Laser Printer tex document Replace Command with its Output on Command Line `…` 7.2 The Printer Queue 3.6 Job Control Print a File lp [-dpr] filename Run Command in the Background & lpcae filename Stop Foreground Job CTRL-Z Check Quota lpquot List of Background Jobs jobs List Queue lpq Bring Job Forward %[n] Stop Job lprm Resume Job in Background %[n] & 8. Miscellaneous 4. Processes 8.1 Miscellaneous Commands Listing ps [-[ef]] Terminating kill [-9] PID List Commands for Subject man -k subject Timing time command Display Current Date and Time date time is a number up to 4 digits. script is the name of a file Log off exit containing the command line(s) to perform. Electronic Mail pine Display Documentation man command 5. Users 8.2 Control Keys Seeing Who is Logged In who Abort Program CTRL-C w Backspace (Delete Last Character) CTRL-H Seeing Your User Name whoami Pause Display on Screen CTRL-S Resume Display after CTRL-S CTRL-Q 6. Managing Files Send Job to Background CTRL-Z followed by bg 6.1. Looking Up Files
  • 3. Is this document clear? Is it missing crucial information? Please mail comments to the handout editor, CAE, 1410 Engineering Drive, or to: editor@engr.wisc.edu