Dal Vms a Unix
Cern Unix guide
Programmi da caricare su alboot:trn,pbmplus,xv,xanim,gs,gv,mpegplay,perl
Compendio di comandi Unix
cp in out COPY in out
cat fln TYPE fln
mv old new RENAME old new
rm fln DELETE fln
mkdir dir CREA/DIR dir
cd dir SET DEF dir
ls dir DIR dir
pwd SHO DEF
man cmd HELP cmd
xhost +alboot per autorizzare alboot a inviare grafica al server XWindows
su telnet come SYSTEM
find . -name cicli -print DIR [...]cicli
find . -name '*.html' -print DIR [...]*.html
ln -s filename1 filename2 ASSIGN filename1 filename2
lpr -Plps17 filename PRINT/printer= filename
cat /etc/printcap(to know names of printer)
qsub -q xus script SUBMIT commandfile
qstat to know the name(request-id) and status of job
qusage to know how much CPU has already spent
qstat -a list of all jobs
qdel -9 request-id kills a job
cd /var/spool/nqs/nqs/*request-id.shift50
gdb program run/debug program
chmod 755 filename UNPROT filename
man -k keyword
cd /usr/man; ls -R | more
passwd userid SET PASSWORD
yppasswd "
kpasswd (on cms)
crontab update.txt
crontab -e
crontab -r
tar xvf filename
phone -A zito(on Cern machines)
quota -v SHO QUOTA (aloha)
vquota -u zito Sho quota (alboot)
afsquota Sho quota (on afs)
fs examine
wc -l returns length of file in number of lines
cut -b 53- httpd-log.Dec1197 | sort | uniq | more
fs setacl . cern:nodes read remove protection to afs files
ssh -l username host
xwho username (dalle macchine Cern per conoscere le macchine usate)
mail bltierney@lbl.gov (or VAXBA0::ZITO for Decnet)
Subject: Sabbatical year at Lbl
~r /tmp/zito/tierney.msg
~p
(line with only a . or CTRL_D)
trn commands
n - next post
k - next thread(junk all posts in current thread)
ed commands
1,10 p print lines 1-10
1,10 n '' with line number
1,10 d
$ n list last line
w filename
q
shell command language
METACHARACTER: a subset of the special character that represent other
characters
1) Asterisk(*): matches any string of characters, including a null string
2) Question mark(?): matches any single character of a file name
3) Bracket([]): Use brackets ([]) when you want the shell to match any
one of several possible characters that may appear in one
position in the file name
SPECIAL CHARACTERS: The shell language has special characters that perform
a variety of useful functions
1) Ampersand(&): Used to execute commands in background mode, thus freeing
your terminal for other tasks: command &
2) Semicolon(;): You can type two or more commands on one line as long
as each pair is separated by a semicolon(;)
3) Backslash(/): The shell interprets the backslash as an escape character
that allows you to turn off any special meaning of the
character immediately after it.
4) Quotes: Single quotes ('...') turn off the special meaning of
any character. Double quotes ("...") turn off the special
meaning of all character except $ and `, which retain
their special meanings with double quotes. A common use
of quotes as escape characters is for turning off the
special meaning of the blank space.
INPUT AND OUTPUT REDIRECTION: The UNIX system lets you reassign the standard
input and output to other files and programs, known as redirection.
1) Redirecting Input: the < Sign: To redirect input, specify a file name
after a less than sign (<) on a command line:
command < file
2) Redirecting Output to a File: the > Sign: To redirect output, specify
a file name after the greater than sign (>) on a command line:
command > file
3) Appending Output to a File: the >> Symbol: To keep from destroying an
existing file, you can also use the double redirection symbol
(>>), as follows: command >> filename , which appends the
output of a command to the end of the file filename.
4) Redirecting Output to a Command: the Pipe(|): Pipes are powerful tools
that allow you to take the output of one command and use it as
input for another command without creating temporary files.
5) Substituting Output for an Argument: The output of any command may be
captured and used as arguments on a command line. This is done
by enclosing the command in grave accents (`...`) and placing
it on the command line in the position where the output should
be treated as arguments.
EXECUTING AND TERMINATING PROCESSES
1) Running Command with BATCH and AT
The batch and at commands allow you to specify a command or sequence
of command to be run at a later time. With the BATCH command, the
system determines when the commands run; with the AT command, you
determine when the commands run.
2) Terminating Active Processes
The KILL command is used to terminate active shell processes:
KILL PID
3) Using the NOHUP Command
If you want a background process to continue running after you log
off, you must use the NOHUP command to submit that background command:
NOHOUP command &
UNIX MAIL COMMAND
-------------------
# display message number.
- print previous.
+ next (no delete).
! cmd execute cmd.
a position at and read newly arived mail.
dq delete current message and exit.
d[#] delete message.
ha display all headers.
hd display headers of letters scheduled for deletion.
h[#] display headers around # (default current message).
m user mail (and delete) current message to user.
n next (no delete).
p print.
q quit.
r[args] reply to (and delete) current letter via mail[args].
s[file] save (and delete) current message (default mbox).
u[#] undelete message # (default current message).
w[file] save (and delete) current message without header.
x exit without changing mail.
y[file] save (and delete) current message (default mbox).
BASIC UNIX SYSTEM COMMANDS
------------------------------
AT - Request that a command be run in background mode at a time you specify
on the command line.
BANNER - Display a message (in words up to 10 characters long) in large
letters on the standard output.
BATCH - Submit command(s) to be processed when the system load is at an
acceptable level.
CAT - Display the contents of a specified file at your terminal.
CD - Change directory from the current one to your home directory. If you
include a directory name, the directory will change from the current one
to the directory specified.
CP - Copy a specified file into a new file, leaving the original file intact.
CUT - Cut out specified fields from each line of a file.
DATE - Display the current date and time.
DIFF - Compare two files.
ECHO - Display input on the terminal, including the carriage return, and
return a prompt.
ED - Edit a specified file using the line editor.
GREP - Search a specified file(s) for a pattern and print those lines that
contain the pattern.
KILL - Terminate a background process specified by its process identification
number (PID).
LEX - Generate programs to be used in simple lexical analysis of text, perhaps
as a first step in creating a compiler.
LP - Print out the contents of a specified file on a line printer.
LPSTAT - Display the status of any requests made to the line printer.
LS - List the names of all files and directories except those whose names
begin with a dot (.).
MAIL - Display any electronic mail you may have received at your terminal,
one message at a time.
MAKE - Maintain and support large programs or documents on the basis of
smaller ones.
MKDIR - Make a new directory.
MV - Move a file to a new location in the file system. You can move a file
to a new file name.
NOHUP - Place execution of a command in the background, so it will continue
executing after you log off the system.
PG - Display the contents of a specified file on your terminal, a page at
a time.
PR - Display a partially formatted version of a specified file at your
terminal.
PS - Display the status and number of every process currently running.
PWD - Display the full pathname of the current working directory.
RM - Remove a file from the file system.
RMDIR - Remove a directory.
SORT - Sort a file in ASCII order and display the results on your terminal.
SPELL - Collect words from a specified file and check them against a spelling
list. Words not on the list or not related to words on the list are displayed.
UNAME - Display the name of the UNIX system on which you are currently working.
UUCP - Send a specified file to another UNIX system.
UUNAME - List the names of remote UNIX systems that can communicate with
your UNIX system.
UUPICK - Search the public directory for files sent to you be the UUTO command.
UUSTAT - Report the status of the UUTO command you issued to send files
to another user.
UUTO - Send a specified to another user.
VI - Edit a specified file using the VI screen editor.
WC - Count the number of lines, words, and characters in a specified file
and display the results on your terminal.
WHO - Display the login names of the users currently logged in on your UNIX
system.
YACC - Impose a structure on the input of a program.