Linux is Unix-like operating system that comes in an endless number of flavors. Its popularity comes from the fact that it is user-supported and free. In Hall B at JLab, we use the CentOS.
To get started, you must have an account on at least one CMENP linux machine. Log into your account and take it for a test drive.
- Open up a terminal. In CentOS, it should be in the Application -> System Tools in the toolbar menu.
- Familiarize yourself with the following commands. CentOS has a useful link here.
- man
- echo
- ls
- mkdir
- rmdir
- cd
- pwd
- mv
- cp
- rm
- cat
- less
- ln
- whoami
- history
- uname -a
- top
- df -h
- du -h
- date
- Command line flags
- Test out some command line flags like ls -l and ps -aef. You can learn about flags in the man command.
- Aliases
- Command lines can get very long. Learn about the alias command to make your life easier.
- Environment variables
- Learn about using environment variables to create shortcuts. For example, type ls -l $HOME in the terminal.
- The .bashrc script.
- Learn about the .bashrc script and its function. Add some aliases and environment variables to save your shortcuts.
- This brings up the point about hidden files that start with a dot. Use the ls -a command to list them.
- Learn how to write bash scripts.
- Learn how to use the source command.
- Write a simple, executable bash script that will print "Go Griffs!" to the screen.
- Write a simple, executable bash script with an input on the command line. When the input is "1", print "Go Griffs!". When the input is "2", print "Beat Niagara".
- Learn about processes and redirection.
- Learn how to put a process into the background and to return to the terminal prompt.
- Learn how to redirect the output from a program into a text file. Try it with the bash scripts about.
- Learn how to direct file input into a script from the command line.
- Learn about logging into a remote computer with ssh.
- From a different computer, log into your account on ferb.canisisu.edu.
- On a Windows PC, you can install software named Putty to ssh into a CMENP linux computer.
- For file transfer, use the scp command.