Linux Commands
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Linux Commands

on

  • 2,711 views

 

Statistics

Views

Total Views
2,711
Views on SlideShare
2,576
Embed Views
135

Actions

Likes
1
Downloads
117
Comments
0

2 Embeds 135

http://lug-sjsu.org 130
http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Linux Commands Presentation Transcript

  • 1. Linux User Group @ SJSU Linux Commands (Find PocMan on lug-sjsu.org)
  • 2. Linux User Group at San Jose State University BASH – Bourne Again Shell
    • What is a Shell?
    • Customizing the environment
    • - Local and Environment variables
    • HOME, SHELL, PS1
    • PATH, LD_LIBRARY_PATH
    • - Aliases
    • alias ll=‘ls –l’
    • - Command history
    • history, !!, !#
    • - Initialization Scripts
    • .bashrc file
  • 3. Linux User Group at San Jose State University BASH contd.
    • Redirecting
      • standard input <
      • standard output >
      • standard error 2>
    • Pipes |
    • Command Substitution ``
    • Wild-Cards
      • * ? [ijk] [!ijk] [x-z]
  • 4. Linux User Group at San Jose State University Basic File System commands
    • cd – Changing the current directory
    • ls – Listing directory contents
    • mkdir – Making directories
    • rmdir – Removing directories
    • pwd – Checking current directory
  • 5. Linux User Group at San Jose State University Basic File commands
    • cat – Displaying file contents
    • cp – Copying a file
    • mv – Renaming files
    • rm – Removing files
    • file – Knowing the file types
    • Soft and Hard links
  • 6. Linux User Group at San Jose State University Backing up files
    • gzip - Compressing Files
    • gunzip - Decompressing Files
    • tar – Archival program
  • 7. Linux User Group at San Jose State University Basic File Attributes
    • Listing file attributes `ls -l`
    • File Ownership
    • File Permissions
    • Directory Permissions
    • chmod – Changing File ownership
  • 8. Linux User Group at San Jose State University The Process
    • Basics process commands
    • ps, pstree, top
    • Process states
    • ‘ ctrl z’ – suspend a process
    • ‘ ctrl c’ - kill a process
    • Runnning Jobs in Background
    • '&' , bg, fg
    • kill - Killing Processes with Signals
  • 9. Linux User Group at San Jose State University Networking commands/tools
    • Checking the network
    • ping, traceroute, ifconfig, netstat
    • DNS
    • host, nslookup, dig
    • Remote Login
    • telnet, ssh
  • 10. Linux User Group at San Jose State University Miscellaneous commands
    • man & info
    • who, whoami
    • touch
    • finger, finger <username>
    • whereis, which
    • df, du
    • shutdown
  • 11. Vi
    • vi filename [count][command]
    • (count repeats the effect of the command)
    • Vi starts in command mode. The positioning commands operate only while vi is in command mode. You switch vi to input mode by entering any one of several vi input commands. Once in input mode, any character you type is taken to be text and is added to the file. You cannot execute any commands until you exit input mode. To exit input mode, press the escape ( Esc ) key.
    Linux User Group at San Jose State University
  • 12. grep
    • What Is grep?
    • Grep is a tool that originated from the UNIX world during the 1970's. It can search through files and folders (directories in UNIX) and check which lines in those files match a given regular expression. Grep will output the filenames and the line numbers or the actual lines that matched the regular expression. All in all a very useful tool for locating information stored anywhere on your computer, even (or especially) if you do not really know where to look.
  • 13. grep contd..
    • grep -i – ignores case
    • grep -A Num– prints Num lines after context
    • grep -B Num– prints Num lines before context
    • grep -C Num – prints Num lines around context
  • 14. Grep contd..
    • grep -c – returns count of matching lines
    • grep -H – return filenames in which match is found.
    • grep -d type – searching in directories. Where type can be one of the following
      • skip (skip directories specified)
      • recurse (iterate into directories search each file in the directory)
      • read (read directories)
  • 15. Grep contd..
    • Regular Expressions
      • [ ] - range of characters
      • * - matches zero or more times
      • + - matches one or more times
      • ^ - beginning of line
      • $ - end of line
      • ? - match is optional and matches at most once
      • {n} – matches n occurrence
  • 16. Cut
    • To extract information from section from each line of input (usually files)
    • Extraction can be done based on
    • -b – bytes
    • -c – characters
    • -f – fields
    • -d – delimiter (default is tab)
  • 17. Cut contd..
    • A range must be provided in order to extract informations.
    • -N – to end of line
    • -M – from beginning of line till M
    • Usually N and M are counted from 1 (not 0). If we specify 0, latest version errors out but previous versions assumes it to be 1.
  • 18. 03/09/10 Linux User Group at San Jose State University By Rohit Surve and Harish Krishnan