Skip to main content

A Brief Linux Reference Guide

Working with directories

  • mkdir <name>  
    • make subdirectory with specified name
  • rmdir <name> 
    •  remove specified subdirectory
  • cd <name> 
    •  move down to specified subdirectory
  • cd .. 
    • move up one directory level
  • ls 
    •  get a directory listing
  • ls -l 
    • directory listing, long format (letter l)
  • ls -al 
    • directory listing, including hidden files

 

 

Working with files

  • more <filename> 
    • display the contents of the file, a page at a time (press <space> to go to next page, or <b> to back up to the previous page)
  • chmod <permissions> <file> 
    • set the permissions on <file>
  • chown <UID>.<GID> <file> 
    •  change the user.group owner of <file>
  • cp <source> . 
    • copy specified file to current directory
  • cp <source> <dest> 
    •   copy file <source> to the destination
  • mv <old> <new> 
    • rename the file from <old> to <new>
  • mv <old> <dest> 
    • move the file <old> to the destination
  • rm <file> 
    • remove the specified file
  • rm * 
    • remove all files in current directory
  • head <file> 
    • display the first 10 lines of <file>
  • head -20 <file> 
    • display the first 20 lines of <file>
  • tail <file> 
    • display the last 10 lines of <file>
  • tail -20 <file> 
    • display the last 20 lines of <file>

Administration

  • man <command> 
    • display the manual for <command>
  • passwd
    • change your account's password
  • chfn 
    • change your account's full name
  • top 
    •  display all running processes
  • kill <pid> 
    • kill one of your processes
  • ps -u <user> 
    • display all running processes for <user>

 

Special files

  • public_html 
    • directory in which all web pages should reside
  • .profile 
    • account setup file (similar to autoexec.bat)
  • .forward 
    • used to forward email to another email address