Unix Help File Notes
Unix Commands all ECE Grad Students Should Know
- Very basic commands (many csh or tcsh commands)
- cd
- ls -l -L -R -t -1
- history
- alias
- !<command_number>
- !<beginning characters of previous command line>
- !!
- <new_command> !$
- <command_1> | <command_2>
- <command_1> | <command_2> > <output_file>
- set
- setenv
- su
- find
- directory: .
- directory: ..
- directory: ~
- directory: /
- File handling commands
- cat
- less -Mq
- more
- tail
- head
- chmod
- chgrp
- ln -s
- File processing commands
- grep
- fgrep
- egrep
- sort
- diff
- tkdiff
- sed
- awk
- wc
- System commands
- top
- ps
- jobs
- kill
- <ctrl> z
# To suspend a job
- bg
# For backgrounding jobs
- df
- du
- w
- finger
- To shutdown a linux computer:
- Never ever shut down a machine unless you are sure
no one is logged in. The only exception is if the 110V
building power is off and the machine is running from its
UPS power supply.
- Before shutting down pizza, always check first if the proposed
time is ok with support@ece and give at least one day notice
to all users including users in other groups (e.g., Raj's).
Bringing down pizza often hangs all machines that mount
pizza's partitions and requires that they be rebooted.
- Type w and
finger to check
for other users.
- Type top to check
for running programs.
- Type ps -aux | less to
check for user programs.
- sudo /sbin/shutdown -h +3
'Machine going down for [reason]'
# To shutdown machine in 3 minutes with message for any users
possibly missed, and to put reason in system log files.
- sudo /sbin/shutdown -h now
'Shutting down because power is off'
# Use only when 110V building power is off (and machine is running
from its UPS).
- General but less common commands
- spell, ispell
- uniq
- groups <user_name>
Good computer habits and etiquette
- Write text files (documents, code, etc.) with no more than 80 columns
of text. Many people use multiple 80-column terminals side by side and
wider columns are very annoying.
Notes on various things
Public & private key authentication with SSH.
1. Run "ssh-keygen -t rsa -b 1024", enter a password if you like.
Just press enter to have no password for authentication. This
generates two files, "id_rsa" (private key), and "id_rsa.pub"
(public key). By default these will be in "~/.ssh/".
2. Copy the the contents of "id_rsa.pub" into the file
"~/.ssh/authorized_keys2" on the remote system.
Ex: "cat id_rsa.pub >> ~/.ssh/authorized_keys2"
3. Copy "id_rsa" to "~/.ssh" on your local system if not already
there.
(Append if it's already there?)
4. Now simply login using "ssh user@host" and a password will no
longer be required unless you set a password on your key files.
(What are the "key files" and how is a password set on them?)
WARNING: Protect your private key by keeping it in a safe location.
Someone who has your private key can login as you without a password,
even if you change your password. If this happens you will have to
generate a new public/private key pair and follow these steps again.
VCL |
ECE Dept. |
UC Davis
Last update: June 24, 2008