File status/control commands


ls [-options] [arguments] # list files command.
  • lists contents of current directory.
  • lists contents of named directory.
  • confirms existence of named file.

    Options


    whereis cmd-name # lists available alternative versions of a command. Also man pages and source files.
    stat filename # shows status and permissions of named file. Filename must exist.
    file filename # display basic file type of named file.
    touch target-file # updates the time-stamp on the file
  • if target-file doesn't exist, create empty regular file.

    Options


    cp source destination # copies contents of file and assigns a name to new file.
  • cp source-file target-file
    If target-file is existing regular file, data will be overwritten.
  • cp source-file1 source-file2 target-directory
    File[s] will be copied into target-directory.
  • Cannot copy directory without use of -R option.

    Options


    mv source destination # move or rename file.
  • mv old-file new-file
  • mv file-list target-directory Options :
    mkdir dirname # create a directory file
    rmdir dirname # remove a directory file
  • directory to be removed must be empty of any files.
    ln target new-name # links a new filename to a target filename. Type of alias.