1 Local computing
1.1 Mac OS
- Root =
/ - Other disks (USB, etc.) mounted under
/Volumes - User directories under
/Users; your home directory at/Users/yourusername - System wide applications under
/Applications; users can also install applications under/Users/username/Applicatons - User specific config files under
/Users/username/Library(hidden by default) - Unix related executables under
/bin,/sbin, etc. PATHis an environment variable, settable from command line or~/.profile
1.2 Windows 10/11
- Root =
C:\ - Other disks mounted as
D:\,E:, etc. - User directories under
C:\Users; your home directory atC:\Users\yourusername - System wide applications under
c:\Program Files(64 bit) andC:\Program Files (x86)(32 bit) Pathvariable settable from “System Properties” dialog
1.3 Both
Standard shortcuts like “Desktop”, “Documents”, and “Downloads” are usually subdirectories of your home directory
Hidden files and directories can be viewed by setting appropriate options in Finder / Explorer
1.4 Recommendations for file naming schemes
Avoid spaces (or other non-printing characters) and punctuation other than dashes, underscores, and periods in file names
File names that include dates should preferably follow the ISO-8601 formatting standard, which has the form “YYYY-MM-DD”. For example, an experiment done of Jan 12, 2022 should be named something like “2022-01-12-Expt01.csv”.
- The advantage of this is it makes it easy to sort and search by date
Try and be consistent in your naming schemes. I promise this will make your life (and/or that of your collaborators) easier at some point in your research career!
See further recommendations from Iowa Stat University’s Open Research Data Repository
1.5 Terminology
- A “terminal” is a text input/output environment for interacting with your computer. A terminal used to be a physical device attached to a computer. Strictly speaking, these days we run “terminal emulators” – graphical programs that emulate terminals.
- A “shell” is a program that runs in a terminal that processes and interprets the command you type. You can run different shells in the same terminal.
1.6 Mac OS
- Terminal accessed by running “Terminal” program (in the “Applications/Utilities” folder)
- Default shell is zsh; but bash also included by default (invoke at command line by typing
bash)
1.7 Windows
- Default terminal is “Command Prompt” but new “Windows Terminal” is better choice
- Several options for shell but I recommend “PowerShell”
1.9 Shortcuts for working with the file system
~– refers to the users home directory.cd ~= change to my home directoryls ~/*.txt= list all files ending with the prefix.txtin your home directory
.– the current directorycd ./tmp= move to the directory calledtmpthat is located in the directory thecdcommand is executed from.
..– the directory above the current directory (if it exists)cd ..= move up one level in the directory hierarchy. For example ifpwdis/home/jsmiththencd ..moves you to/home
/– the root directory of the file systemcd /data= move to thedatadirectory that is the subdirectory of the rootls /= list all files and directories in the root directory