Most of the Linux commands given in this wiki space assume basic familiarity with Linux and Bash (Bourne Again SHell). Bash is is typically the default shell on most distros. For ITC personnel who have less experience with Linux, you may trip over some "simple" things. This page contains a number of tips which may help get your head and fingers used to bash. Note that some of the tuning and troubleshooting information has been moved to Troubleshooting/Tuning Tools
For OpenVMS Admins
If you're experienced with OpenVMS, you will hate bash (for a while, or for a long time). You'll miss things like /LOG and /CONFIRM doing the same thing on every command. You'll be annoyed that everything is case-sensitive. You'll wonder why your typing 'cat' (or maybe 'dog') to TYPE a file and 'less' to page through a file. For while, you may try to customize your
~/.bashrc file to have aliases that make it seem like DCL (I know, I tried).
My best advice, learned the hard way, is just let it go. The world didn't learn the lessons that DCL could have taught it. However, what bash and the GNU utilities lack in expressiveness and consistency, it more than makes up for in raw power and flexibility. It may take years, but you'll eventually learn to appreciate the bash/GNU combo and get proficient at it. Fortunately, Google knows the answer to every bash question you're ever going to have. Use it.
Here are a few links with a mapping from between VMS and Linux:
|cat [filename]||Display file’s contents to standard output|
|cd /directorypath||Change to directory.|
|chmod mode filename||Change a file’s permissions.|
|chown filename||Change who owns a file.|
|cp source destination||Copy files and directories.|
|date||Display or set the system date and time.|
|df||Display used and available disk space.|
|du||Show how much space each file takes up.|
|file filename||Determine what type of data is within a file.|
|find [pathname] [expression]||Search for files matching a provided pattern.|
|grep pattern [filesname]||Search files or output for a particular pattern.|
|kill pid||Stop a process. If the process refuses to stop, use kill -9 pid.|
|less [filename]||View the contents of a file one page at a time.|
|ln source [destination]||Create a shortcut.|
|ls||List directory contents.|
|man [command]||Display the help information for the specified command.|
|mkdir directory||Create a new directory.|
|mv source destination||Rename or move file(s) or directories.|
|passwd [name [password]]||Change the password or allow (for the system administrator) to|
change any password.
|ps||Display a snapshot of the currently running processes.|
|pwd||Display the pathname for the current directory.|
|rm directory||Remove (delete) file(s) and/or directories.|
|rmdir directory||Delete empty directories.|
|ssh user@machine||Remotely log in to another Linux machine, over the network.|
Leave an ssh session by typing exit.
|su [user [arguments]]||Switch to another user account.|
|tail [filename]||Display the last n lines of a file|
|tar filename||Store and extract files from a tarfile (.tar) or tarball (.tar.gz or .tgz).|
|top||Displays the resources being used on your system.|
Create an empty file with the specified name.
|nohup command &||execute command in detached job|
|history||shows the command line history|
|useradd username||create a user|
|passwd username||sets a password and unlocks the user|
|usermod -a -G groupName userName|
add user to a group
|visudo||Modify the /etc/sudoers file. Members of groups specified in this file can obtain sudo access|
|Ctrl + A||Go to the beginning of the line you are currently typing on|
|Ctrl + E||Go to the end of the line you are currently typing on|
|Ctrl + U||Clears the line before the cursor position. If you are at the end of the line, clears the entire line.|
|Ctrl + H||Same as backspace|
|Ctrl + R||Let's you search through previously used commands|
|Ctrl + C||Kill whatever you are running|
|Ctrl + D||Exit the current shell|
|Ctrl + Z||Puts whatever you are running into a suspended background process. fg restores it.|
|Ctrl + W||Delete the word before the cursor|
|Ctrl + K||Clear the line after the cursor|
|Ctrl + T||Swap the last two characters before the cursor|
|Esc + T||Swap the last two words before the cursor|
|Tab||Auto-complete files and folder names|
Part of the reason that I created the
ssdt-utils image is so that we could distribute utilities to you that would ease your way into linux (and so I didn't have to document so many arcane commands). See Install and Update SSDT Utils package.
The ssdt-utils container, among other things, creates a
utils alias in your process which allow you to executed bunded commands. When you execute a utils command, a temporary container is created which maps your current working directory to
/tmp in the container. You can then use utilities to operate on your current directory. For example, to edit a file in your current directory with
~/.bashrc file is like the LOGIN.COM on VMS. You should already have one. But it's a "hidden" file (because it starts with a dot). You can edit the file with
Crontab is used in Linux distributions to schedule jobs. It can be scheduled for specific minute(s), hour(s), day(s), and so forth. More information can be seen here. The Wikipedia article explains it fairly well also.
Look at existing crontab:
Edit existing crontab:
In the following example, jobs are scheduled on a daily basis (as the root user) to update the ssdt utilities at 1:00 a.m., run the /ssdt/scripts/updates-pull.sh to pull any updated images at 1:10 a.m., and apply the updates to the /data/production directory tree at 1:30 a.m. Also, it is writing to a logfile for each job. The > syntax overwrites any exiting logfile with the same fully qualified name, and >> appends to any existing logfile with the same fully qualified name (and it will create one if none exists). A date can be added to the log file name. Note when adding a date, use ` (it is generally on the ~ key) and not '. Note that each crontab is user specific.
Linux is case sensitive, including commands and filename. Also, most Linux terminals use auto complete. This can be quite a time savings when you don't remember the exact name of the file.