Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page should serve as a reference for the many "things Linux" we use in this course. It is by no means complete – Linux is **huge** – but offers introductions to many important topics.

...

  • Macs and Linux have a Terminal program built-in
  • Windows options:

Use ssh (secure shell) to login to a remote computers.

Code Block
languagebash
titleSSH to a remote computer
# General form:
ssh <user_name>@<full_host_name>

# For example
ssh abattenh@ls6.tacc.utexas.edu

...

Code Block
languagebash
tail /etc/passwd | while IFS=':' read account x uid gid name shell
do 
  echo $account $name
done | more

File attributes

Consider a long listing of our Home directory.

Image Added

There are 9 whitespace-separatedcolumns in this long listing:

  1. file permissions - a 10-character field
  2. number of sub-components associated with a directory - rarely important
  3. account name of the file owner
  4. Unix group associated with the file
  5. file size
  6. last modification month
  7. last modification day
  8. last modification year, or last modification hour/minute if within the last year
  9. file name

Notice I call everything a file, even directories. That's because directories are just a special kind of file – one that contains information about the directory's contents.

Owner and Group

A file's owner is the Unix account that created the file (here abattenh, me). That account belongs to one or more Unix groups, and the group associated with a file is listed in field 4.

The owner will always be a member of the Unix group associated with a file, and other accounts may also be members of the same group. G-801021 is one of the Unix groups I belong to at TACC. To see the Unix groups you belong to, just type the groups command.

Permissions

File permissions and information about the file type are encoded in that 1st 10-character field. Permissions govern who can access a file, and what actions they are allowed.

  • character 1 describes the file type (d for directory, - for regular file, l for symbolic link)
  • the remaining 9 characters are 3 sets of 3-character designations
    • characters 2-4: what the owning user account can do
    • characters 5-7: what other members of the associated Unix group can do
    • characters 8-19: what other non-group members (everyone) can do

Each of the 3-character sets describes if read ( r ) write ( w) and execute ( x or s ) actions are allowed, or not allowed ( - ).

  • read ( r ) access means file contents can be read, and copied
  • write ( w ) access means a file's contents can be changed, and directory contents can be modified (files added or deleted)
  • execute ( x or s )
    • for files, execute ( x ) means it is a program that can be called/executed
      • e.g. /usr/bin/ls, the file that performs the ls command
    • for directories, execute ( x ) means directory operations may be performed/executed
      • the directorycan be listed and changed into

Examples:

ls -l ~/.bash_history

haiku.txtdescription

Image Added

  • dash ( - ) in position one signifies this is a regular file
  • rw- for owner allows read and write access
  • r-- for group permits only read access
  • --- for everyone means no access allowed

ls -l /usr/bin/ls

/usr/bin/ls
description

Image Added

  • /usr/bin/ls is the program that performs the ls command
    • root (the master admin account) is the owner, in the root group
  • dash ( - ) in position one signifies this is a regular file
  • rwx for owner allows read, write and execute
  • r-x for group permits read and execute
  • r-x for everyone permits read and execute

ls -l -d ~/local (-d says to list directory information, not directory contents)

docs
description

Image Added

  • d in position one signifies this is a directory
  • rwx for owner allows read, write and "execute" (list for directories)
  • r-x for group permits read and "execute" (list)
  • --- for everyone means no access allowed

Copying files between TACC and your laptop
Anchor
Copying_files_to_from_TACC
Copying_files_to_from_TACC

...