GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

UNIX Commands

Olivier Joseph Englisch 35 Karten

UNIX Commands

Karten in diesem Stapel (35)

  1. 1what is the structure of a unix commandCOMMAND FLAGS PARAMETER(S)
  2. 2what are flagsFlags are options available on commands. Not all commands need flags. Some REQUIRE them.
  3. 3how are spaces used in commandsspaces need to seperate the command from the flags, and the flags from the parameters, and the parameters from other parameters.
  4. 4lsusage: ls directoryPathname -- lists items in specified directory.
    Flags: -l -a (there's more too!)
  5. 5catview file contents
    usage: cat filenameToView
  6. 6moreview file contents, but pause each screen. Page through each screen with space bar.
    usage: more filenameToView
  7. 7lessview file contents, pause each screen, space bar, use of arrow keys.
    usage: less filenameToView
  8. 8touchcreates file or updates file timestamp
    usage: touch SomeFilename
  9. 9cpcopy file to another file or location
    usage: cp WhatToCopy WhereToCopyTo
    Flags: -i -r
  10. 10mvmove file to another file or location (move file to another file, whaaaaaa?)
    usage: mv WhatToMove WhereToMoveTo
  11. 11rmremove file (or directory... hmmmmm...)
    usage: rm FileToDelete
  12. 12pwddisplays absolute pathname to current directory
    usage: pwd
  13. 13mkdircreate directory
    usage: mkdir NewDirectoryName
  14. 14rmdirremove directory (EMPTY ONES ONLY!)
    usage: rmdir DirectoryToRemove
  15. 15cd(change directory) navigate through directories
    usage: cd WhereToMoveTo
  16. 16wcword count
    usage: wc FileToTakeWordCountOf
    flags: -w -c -l
  17. 17passwduse this command to change your account password
  18. 18manuse the man command with any other command name as a parameter to open up a manual page to see useage notes and flags available with any unix command. (you can also list any command name with --help afterwards to see a smaller help page).
  19. 19FilesA well defined repository of information
    ● Program or component of a program
    ● Arbitrary text
    ● An executable (binary text)
    ● Special files called directories contain or point to other files
  20. 20Structure of DirectoriesHierarchically structured like an inverted tree
    ● / is the starting directory or “root”
  21. 21PathnamesLocating a file by following a sequence of directories until you
    reach the file
    ● / is also the separator between the directories and final file
  22. 22Example set of directories and filesExample set of directories and files
  23. 23what are absolute pathnamesstart at root
    ● /home/lister/ships/Starbug
    ● /bin
  24. 24Special symbols for current directory and parent● “..” refers to parent directory (the directory “above”)
    ● “.” is current directory
  25. 25Referencing user directories~rimmer is the absolute pathname to the user directory “rimmer”
    (in the directory “home” in this example)
    ● ~/ is shorthand for the path to your own user directory
  26. 26what is an absolute pathnameAny pathname beginning with / starts from the
    ROOT and is also an ABSOLUTE pathname.
  27. 27what's special about any pathname beginning with ~Any pathname beginning with ~ starts from the
    HOME DIRECTORY
  28. 28is the double slash necessary when referring to a directoryThe pathnames: ../.. and ../../ are the same thing.
    The ending slash is optional and both paths will
    refer to the same directory.
  29. 29Characters in filenamesFile names can contain any characters except “/”,
    but it is recommended that you use upper or lower
    case letters, numbers, and the characters “-” “.”
  30. 30how do you manage file names with spacesalthough a file name could contain a
    space or spaces:
    confusing name
    commands using this would not work correctly unless you
    tell the shell to not break an argument at the spaces by
    quoting the filename.
    rm “confusing name”
  31. 31what does an asterisk doan asterisk “*” matches any number of characters in a
    filename
    ● con* will match con, condor, constant.exe
    ● *.c will match all files that end in .c
    ● rm * will remove all the files in a directory
    a “?” matches any single character in a filename
    ● b?t will match bit, bot, bat. It will not match bt or boot
    ● square brackets “[]” will match any one of the characters in
    the brackets. A hyphen “-” can be used to match any of a
    range of consecutive characters.
    ● [bhr]at will match bat, hat and rat
    ● chap[5-8].c will match chap5.c, chap6.c, chap7.c and chap8.c
  32. 32what types can access a file● user or owner: process spawned by user who created file
    ● group: process spawned by members of the same group
    ● other: process spawned by anyone else
  33. 33what are the permission typesread: access file or list directory
    ● write: write to / remove file (directory)
    ● execute: run file as a program or enter directory
  34. 34how can you view current permissionsCurrent permissions can be viewed using ls -l
    ● First line is the number of disk blocks ( 1 block is 512
    bytes) taken up by all the files
  35. 35changing permissions● Symbolic
    ● Format: chmod [who] [operation] [permissions]
    ● who is one or more of u, g, o
    ● operation is + (add), - (remove), = (set)
    ● Permissions are one or more of r, w, x
    ● Examples
    chmod go-rwx myfile.doc
    chmod g+w myfile.doc
    chmod u=rwx,g=rx,o=r myfile.doc

Informationen

Beschreibung
Karteikarten am UNIX Commands, erstellt von Olivier Joseph am 04/10/2018.
Erstellt von
Olivier Joseph
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck