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:
- Windows 10+
- Command Prompt and PowerShell programs have ssh and scp (may require latest Windows updates)
- Start menu → Search for Command
- Putty – http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- simple Terminal and file copy programs
- download either the Putty installer or just putty.exe (Terminal) and pscp.exe (secure copy client)
- Windows Subsystem for Linux – Windows 10 Professional includes a Ubuntu-like bash shells
- See https://docs.microsoft.com/en-us/windows/wsl/install-win10
- We recommend the Ubuntu Linux distribution, but any Linux distribution will have an SSH client
- Command Prompt and PowerShell programs have ssh and scp (may require latest Windows updates)
- Windows 10+
Use ssh (secure shell) to login to a remote computers.
Code Block | ||||
---|---|---|---|---|
| ||||
# General form: ssh <user_name>@<full_host_name> # For example ssh abattenh@ls6.tacc.utexas.edu |
...
Code Block | ||
---|---|---|
| ||
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.
There are 9 whitespace-separatedcolumns in this long listing:
- file permissions - a 10-character field
- number of sub-components associated with a directory - rarely important
- account name of the file owner
- Unix group associated with the file
- file size
- last modification month
- last modification day
- last modification year, or last modification hour/minute if within the last year
- 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
- for files, execute ( x ) means it is a program that can be called/executed
Examples:
ls -l ~/.bash_history
haiku.txt | description |
---|---|
|
ls -l /usr/bin/ls
/usr/bin/ls | description |
---|---|
|
ls -l -d ~/local (-d says to list directory information, not directory contents)
docs | description |
---|---|
|
Copying files between TACC and your laptop
Anchor | ||||
---|---|---|---|---|
|
...