Intro to Linux Workshop – Cheat Sheet

Intro to Linux Workshop – Cheat Sheet

Intro to Linux Workshop – Cheat Sheet pwd print working (current) directory man command manual $ man ls show manual for ls command cd change directory file permissions special directories r read / the root directory w write ~ your home directory x execute (run) . current directory .. parent directory ls ‐l /bin/bash ‐rwxr‐xr‐x 1 root wheel [ … ] /bin/bash ls list directory contents rwx owner (root) ls –a list all directory contents r‐x group (wheel) ls –l long listing r‐x everyone else cp copy date print the date and time mv move (or rename) rm remove sort sort the lines of a file mkdir make directory grep print lines matching a pattern rmdir remove directory (must be empty) $ grep error myfile show lines containing “error” in myfile cat print file(s) to standard output (usually your screen) redirection and pipes $ date > myfile write date to myfile whoami print user ID $ date >> myfile append date to myfile who am I print user information $ sort < myfile use myfile as input to groups print user groups sort id print user ID and groups $ sort myfile | grep error sort myfile and send output to grep who information about logged‐in users w information about logged‐in users less file reader [space] next page bash b previous page ←→ move left/right on line g go to end of file ↑↓ previous/next command in history / search ^a go to beginning of line ? search backwards ^e go to end of line n repeat search ^k delete to end of line ^g show location in file nano editor $ nano myfile edit myfile ←→ move left/right on line ↑↓ previous/next command in history ^a go to beginning of line ^e go to end of line ^k delete line ^o save file ^x exit sleep 10 sleep 10 seconds echo hi print hi exit exits session logout exits session ^d exits session ^c stop running command ps list processes ps –e list every process ps ‐aux list every process with more info top show processes q quit top .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us