Simple commands

Commands to connect to another machine or user:

Linux Sun Human
xhost HOSTNAME If you want to call X-windows from the other machine, you have to allow them (HOSTNAME) to put the windows on your display.
telnet HOSTNAME Start a telnet connection to another computer.
It will ask you about your USERNAME and PASSWORD
rlogin HOSTNAME
rlogin -l USERNAME HOSTNAME
Build up a remote login to the specified host. With "-l USERNAME" you can choose a different username instead of your actual name. It depends on the other machine, if it will ask for your PASSWORD or not.
su - USERNAME With "su" you can switch to a different user, on the same terminal. The minus is needed for switching also the complete environement.
export DISPLAY=LOCALHOST:0.0 setenv DISPLAY LOCALHOST:0.0 If you like to start X-window programs on this remote machine, you have to tell them on which computer you like to see your window.
The command export or setenv depends on your command shell which is by default the bash on linux and the csh on sun systems. So it can be also exchanged.
exit To leave the remote computer.
passwd With passwd you can change your password.
It will ask you for your old password, and two times for the new one.

 
 

Commands to live in a filesystem:

Linux Sun Human
man -k SEARCHNAME
man COMMAND
Read the online manual about commands.
With "-k" you can search for keywords in the short description of the registered commands.
ls
ls -a
ls -l
ls -al PATH
Display the entries in the actual directory.
"-a" also, but including the hidden files (hidden: all file / folder -names which starts with a "." dot).
"-l" show the entries in the long form with date, size and acls (see at chmod).
You can specify also a different PATH.
cd
cd PATH
Move yourself through the filesystem.
Without any parameter cd will bring you to your HOMEFOLDER.
mkdir FOLDERNAME Create a new folder.
rmdir FOLDERNAME Delete a empty folder.
cp ORIGINAL NEWFILE Copy files, from one to another location.
mv OLDPATHNAME NEWPATHNAME Move a file or folder to an other location;
or rename a file or folder.
rm FILE Remove (delete) one or some files.
ln -s ORIGINALNAME ALIASNAME Create a (symbolic) link of a file or folder.
chmod ugo+r FILE_or_FOLDER_NAME
chmod go-rwx FILE_or_FOLDER_NAME
Change the acl (access rights) of a file or folder.
- rwx rwx rwx = 3 groups of "rwx" for "u" user "g" group and "o" for the rest of the world. For each group you can specify the right for "r" read, "w" write or "x" execute access. At a folder the "x" means the right to go inside the folder. The first item (here "-") show a "d" for a directory, or "l" for a link.
With "ugo+r" you allow everybody to read this.
With "go-rwx" you disallow any access for every boby except yourself ("u" acls not touched).
tar -cf TARFILE.tar PATH1 PATH2
tar -tf TARFILE.tar 
tar -xf TARFILE.tar 
With tar you can copy files and folders (with subfolders) into one file ".tar". The parameter "f" is needed to specify the following TARFILE.
"c" will copy all FILES / FOLDERS into the TARFILE.
"t" will show you the packaged filenames.
"x" will extract the TARFILE.
"z" will compress the TARFILE into ".tar.gz" format; this parameter is not available on Sun, but here is also a solution for Sun systems shown.
tar -czf TARFILE.tar.gz PATH1 PATH2
tar -tzf TARFILE.tar.gz
tar -xzf TARFILE.tar.gz
tar -cf - PATH1 PATH2 | gzip > TARFILE.tar.gz
gzip -c -d TARFILE.tar.gz | tar -tf  - 
gzip -c -d TARFILE.tar.gz | tar -xf -
gzip FILENAME
gunzip FILENAME.gz
This are the most common compression programs. The source file will be replace!
gzip for ".gz" files.
compress for ".Z" files.
zip for ".zip" files.
compress FILENAME
uncompress FILENAME.Z
zip FILENAME
unzip FILENAME.zip

 
 
 

Commands to handle jobs:

Linux Sun Human
nice COMMAND
nice -19 COMMAND
With nice you reduce the priority of the specified command. That means all ´non nice´ commands will be executed much faster. nice is very usefull for long running jobs. With the parameter "-NUMBER" you define different nice levels.
ps
ps ax
ps
ps -ef
ps shows you your running jobs.
With the parameter "ax" or "ef" (solaris 2) you will get all running jobs.
kill PROCESSNUMBER
kill -9 PROCESSNUMBER
xkill
With kill you can remove a running job. "-9" will be the highest priority to stop the process. The needed PID you will get from the ps command.
xkill will kill the next X-application, which you select with your mouse button.
lpr FILENAME
lpr -P PRINTERNAME FILENAME
With "lpr" you can print (mostly ascii or postscript (*.ps)) files. With the parameter "-P PRINTERNAME" it can be used a different printer instead of the default one.
lpq
lpq -P PRINTERNAME
This command will show you the actual status of the (choosen) printer.
lprm JOBNUMBER
lprm -P PRINTERNAME
If you want to delete a printjob from the queue, please use lpq (-P ...) to detect the JOBNUMBER and use lprm (-P ...) to remove this job.

 
 
 
Italic word Example Meaning
ALIASNAME cryo2q0.cal
"cryo2q0.cal -> tmp/ttt/cryo2q0.cal"
A aliasname is the same like a link, which points to the real file or folder. If you delete a link, the original file will be still intact. If you move a link in the filesystem, the correlation will be lost, if the link is relative.
COMMAND ls -l /bin/ls Executable files. The "x" in the acl´s define that the file is executable. If the file is an ascii file, it will be executed each line inside (shell script).
FILE
FILENAME
hallo.txt A file can be data, commands, or everything else. Sometimes also a folder is included in this meaning.
FOLDER
FOLDERNAME
bin Folder = directory, which can contain subfolders and files.
HOSTNAME
HOST
teslahb
teslahb.desy.de
131.169.37.81
IP-Name of the machine.
Usual you can specify also the ip-number instead.
JOBNUMBER 13 Number to specify the print-job (you need it maybe for delete).
LOCALHOST teslahb
teslahb.desy.de
131.169.37.81
The ip-name or number of your local computer. (Where your screen is connected.)
PASSWORD ***** Your personal password.
PATH /home/otto
../../otto2/bin
A path in the filesystem can start at root "/" (absolute) or be relative from your local position.
PRINTERNAME mhfps1
teslaps1
The name of a printer. (Some printers has more than one name, for different types of paper or somthing like that.)
PID
PROCESSNUMBER
102 The processnumber you can get from the ps command. It is used inside the operating system to indicate a running program (process).
TARFILE allesdies.tar A tarfile contains complete folders with subfolders or / and single files. The format is originaly defined for tape archives, and still mostly used.
USERNAME otto Your login-name.

Tux   MHF-SL | DESY   |   [goe]