Some Basic Linux Commands

Discussion in 'Linux' started by yodersj, Dec 27, 2008.

  1. yodersj

    yodersj

    Joined:
    Aug 21, 2008
    Messages:
    72
    Likes Received:
    0
    Location:
    NC
    Just some for the command line (terminal):
    Create, Copy, & Delete
    • cp [from] [to]
      Copy files/directories from one location to another.[/*:m:210npecg]
    • mv [from] [to]
      Move files/directories from one location to another. Can also be used for renaming.[/*:m:210npecg]
    • rm [options] [file]
      Remove files/directories. Wildcards supported for [file].[/*:m:210npecg]
    • mkdir [name]
      Create a directory.[/*:m:210npecg]
    • rmdir [name]
      Remove an empty directory.[/*:m:210npecg]
    • touch [name]
      Creates the [name] if it does not exist or updates the time stamp.[/*:m:210npecg]
    Display
    • ls [options]
      List files/directories. Commonly used options:
      -l = full information
      -a = show files who's name begins with . (aka hidden files)[/*:m:210npecg]
    • find [dir_to_start_in] -name [file_to_find] -print
      Seach for a file. Wildcards accepted.[/*:m:210npecg]
    • pwd
      Print the current directory path you are in.[/*:m:210npecg]
    • df [options]
      Show space available on disk. Without options shows for all mounted file systems. Use the -h option for sizes displayed in a nice format/units.[/*:m:210npecg]
    • du
      Show space used by current directory and sub-directories.[/*:m:210npecg]
    • free
      Display memory usage.[/*:m:210npecg]
    Compressed Files
    • tar -xvf [file].tar
      Extract a tar archive (aka tarball) that is not compressed.[/*:m:210npecg]
    • tar -xzvf [name].tar.gz
      Extract a tar archive that is compressed with gzip. Note the file extension might also be shown as ".tgz".[/*:m:210npecg]
    • tar -xjvf [name].tar.bz2
      Extract a tar archive that is compressed with bzip2.[/*:m:210npecg]
    • gunzip [name].gz
      Uncompress a gziped file.[/*:m:210npecg]
    • bunzip2 [name].bz2
      Uncompress a bziped file.[/*:m:210npecg]
    • unzip [name].zip
      Uncompress a zipped file.[/*:m:210npecg]
    Misc
    • cd [location]
      Change to a new directory. The location can be specified in full ( /[top]/[sub]/[etc] ) or relative to the current directory ( [sub_of_current]/[next]/[etc] ). A shortcut to go up one directory is "cd ..".[/*:m:210npecg]
    • ln [options] [target] [linkname]
      Makes links to selected [target]s. Default is hard links. Typically you use -s, an option, for symbolic links.[/*:m:210npecg]
    • top
      Display process information real-time. Use h for help and q to quit.[/*:m:210npecg]
    • sudo [command]
      Run the command with root/administrator privileges.[/*:m:210npecg]
    • su -
      Switch to the root/administrator user. All commands that are run after this are run with root/administrator privileges. Type "exit" to go back to running as your normal user.[/*:m:210npecg]
     
    yodersj, Dec 27, 2008
    #1
  2. yodersj

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    • cd -
      will take you to the directory you were in before you last changed directory. This can be useful for 'flipping' between directories if you're working on something which involves two directories. [/*:m:1a9ovmqt]
    • cd (on its own)
      will take you back to your home directory[/*:m:1a9ovmqt]
     
    daldred, Dec 27, 2008
    #2
  3. yodersj

    melhiore

    Joined:
    Sep 3, 2008
    Messages:
    1,503
    Likes Received:
    0
    Location:
    Bolton, Lancashire, UK
    melhiore, Dec 27, 2008
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.