Make your own free website on Tripod.com
Updated July 02 2004
The Unix Linux Commands
and Tidbits Page

Say NO to corrupt audio discs

I made this page because I am new to Unix and Linux
I am coming across new commands with lots of switches.
I also needed a place to park these odd tidbits of information I am coming across
These commands and their respective switches most certainly depend on the flavour of OS
I hope this info helps you

1.   How can I use the tar command?
2.   How can I use Gzip?
3.   How can I use bzip2
4.   Mandrake Rescue Disk Modprobe ne.o io=0xxx Fails "No such device or address".."insmod ne failed at ...
5.    I need help with the mkisofs command
6.    I'd like to add my modified Partimage boot disk to the Partimage Bootable CD-ROM image.
7.    I'm tired of using non-free software under MS.  What free/GNU/poscardware ... applications can I use instead?
8.    I have a Solaris box.  I want to reconfigure my IP address, host name, TZ, root password ... and start fresh.  What can I do?
9.    I'd like to browse the solaris CD packages
10.  On my Solaris 9 box I'd like to allow root ftp access
11.  X11 connection rejected because of wrong authentication. Connection lost to X server.  I need help
12.  How can I add Sun's Validation Test Suite (VTS) on my Solaris 9 for Sparc box?
13 .  I need help with command line SCP

 


1.  How can I use the tar command?
Solaris 2.8 Tar Help file

c Create archive file by writing files(s)/directories to a tarfile
r Append files to existing tarfile.
u Add named files if missing or modified since last archive to an existing tarfile
x Extract files(s)/directories from an existing tarfile
t List or "tell" contents of tarfile
v Display file named during create or extract
Location of tarfile
-f /tmp/tarfile Diskfile
-f /dev/rfd0c Floppy disk drive

len# ls -la
total 468
drwxr-xr-x   2 root     other        512 Mar 12 10:56 ./
drwxr-xr-x  32 root     root        1024 Mar 12 10:56 ../
-rw-r--r--   1 root     other        280 Mar 12 10:56 acct.cntl
-rw-r--r--   1 root     other      90120 Mar 12 10:56 acct.data
-rw-r--r--   1 root     other       1306 Mar 12 10:56 config_util.data
-rw-r--r--   1 root     other      53485 Mar 12 10:56 fileacct_main.ps
-rw-r--r--   1 root     other      53627 Mar 12 10:56 printacct_main.ps
-rw-r--r--   1 root     other      34688 Mar 12 10:56 send

len# tar cvf training.tar *
a acct.cntl 1K
a acct.data 89K
a config_util.data 2K
a fileacct_main.ps 53K
a printacct_main.ps 53K
a send 34K

len# ls -la
total 964
drwxr-xr-x   2 root     other        512 Mar 12 10:58 ./
drwxr-xr-x  32 root     root        1024 Mar 12 10:56 ../
-rw-r--r--   1 root     other        280 Mar 12 10:56 acct.cntl
-rw-r--r--   1 root     other      90120 Mar 12 10:56 acct.data
-rw-r--r--   1 root     other       1306 Mar 12 10:56 config_util.data
-rw-r--r--   1 root     other      53485 Mar 12 10:56 fileacct_main.ps
-rw-r--r--   1 root     other      53627 Mar 12 10:56 printacct_main.ps
-rw-r--r--   1 root     other      34688 Mar 12 10:56 send
-rw-r--r--   1 root     other     239104 Mar 12 10:58 training.tar

len# compress training.tar
len# ls -la
total 592
drwxr-xr-x   2 root     other        512 Mar 12 10:59 ./
drwxr-xr-x  32 root     root        1024 Mar 12 10:56 ../
-rw-r--r--   1 root     other        280 Mar 12 10:56 acct.cntl
-rw-r--r--   1 root     other      90120 Mar 12 10:56 acct.data
-rw-r--r--   1 root     other       1306 Mar 12 10:56 config_util.data
-rw-r--r--   1 root     other      53485 Mar 12 10:56 fileacct_main.ps
-rw-r--r--   1 root     other      53627 Mar 12 10:56 printacct_main.ps
-rw-r--r--   1 root     other      34688 Mar 12 10:56 send
-rw-r--r--   1 root     other      62763 Mar 12 10:58 training.tar.Z

len# md test2
len# mv training.tar.Z ./test2
len# cd test2
/Test/test2
len# ls
./               ../              training.tar.Z

len# uncompress *.Z
len# ls -la
total 500
drwxr-xr-x   2 root     other        512 Mar 12 11:01 ./
drwxr-xr-x   3 root     other        512 Mar 12 11:01 ../
-rw-r--r--   1 root     other     239104 Mar 12 10:58 training.tar

len# tar xvf training.tar
x acct.cntl, 280 bytes, 1 tape blocks
x acct.data, 90120 bytes, 177 tape blocks
x config_util.data, 1306 bytes, 3 tape blocks
x fileacct_main.ps, 53485 bytes, 105 tape blocks
x printacct_main.ps, 53627 bytes, 105 tape blocks
x send, 34688 bytes, 68 tape blocks

len# ls -la
total 964
drwxr-xr-x   2 root     other        512 Mar 12 11:02 ./
drwxr-xr-x   3 root     other        512 Mar 12 11:01 ../
-rw-r--r--   1 root     other        280 Mar 12 10:56 acct.cntl
-rw-r--r--   1 root     other      90120 Mar 12 10:56 acct.data
-rw-r--r--   1 root     other       1306 Mar 12 10:56 config_util.data
-rw-r--r--   1 root     other      53485 Mar 12 10:56 fileacct_main.ps
-rw-r--r--   1 root     other      53627 Mar 12 10:56 printacct_main.ps
-rw-r--r--   1 root     other      34688 Mar 12 10:56 send
-rw-r--r--   1 root     other     239104 Mar 12 10:58 training.tar 


tar from one dir to another saving permissions and structure easily.
tar cf - . |(cd /destination ;tar xfp -)
tar    command
cf    create file
-    STDOUT
.    current working dir
|    pipe stdout of first command into stdin of second command
( )    open and run command in a new shell
cd /dest guess
;    command delimiter
tar    guess
xfp    extract file w/protection information (permissions)
-    stdin 
 

2.  How can I use Gzip?
Mandrake Linux 7.2 Kernel 2.2.17 Gzip help file

usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
 -c --stdout      write on standard output, keep original files unchanged
 -d --decompress  decompress
 -f --force       force overwrite of output file and compress links
 -h --help        give this help
 -l --list        list compressed file contents
 -L --license     display software license
 -n --no-name     do not save or restore the original name and time stamp
 -N --name        save or restore the original name and time stamp
 -q --quiet       suppress all warnings
 -r --recursive   operate recursively on directories
 -S .suf  --suffix .suf     use suffix .suf on compressed files
 -t --test        test compressed file integrity
 -v --verbose     verbose mode
 -V --version     display version number
 -1 --fast        compress faster
 -9 --best        compress better
 file...          files to (de)compress. If none given, use standard input.

gzip -v netspot-v329-us-solaris.tar      (-N  Can be used to preserve the original file)
This will Gzip the netspot-v329-us-solaris.tar file replacing it with netspot-v329-us-solaris.tar.gz
 

3.  How can I use bzip2?
Mandrake Linux 7.2 Kernel 2.2.17 bzip2 help file

bzip2, a block-sorting file compressor.  Version 1.0.1, 23-June-2000.

   usage: bzip2 [flags and input files in any order]

   -h --help           print this message
   -d --decompress     force decompression
   -z --compress       force compression
   -k --keep           keep (don't delete) input files
   -f --force          overwrite existing output files
   -t --test           test compressed file integrity
   -c --stdout         output to standard out
   -q --quiet          suppress noncritical error messages
   -v --verbose        be verbose (a 2nd -v gives more)
   -L --license        display software version & license
   -V --version        display software version & license
   -s --small          use less memory (at most 2500k)
   -1 .. -9            set block size to 100k .. 900k

   If invoked as `bzip2', default action is to compress.
              as `bunzip2',  default action is to decompress.
              as `bzcat', default action is to decompress to stdout.

   If no file names are given, bzip2 compresses or decompresses
   from standard input to standard output.  You can combine
   short flags, so `-v -4' means the same as -v4 or -4v, &c.


4.  The Mandrake Rescue Disk Modprobe ne.o io=0xxx. Fails "No such device or address".."insmod ne failed at ...  I need help
I found this to be a pain with Mandrake 7.2, 8.0 and 8.2
I searched the net but found no solution
Here's a work around I found works
When you typed Modprobe ne.o ... The required module 8390.o was extracted and installed just fine.  Good
The ne.o module was also extracted to /tmp.  Good as well
The trick is to not use Modprobe but rather use insmod
If you type insmod you are bugged to use modprobe instead ...
Ok so we need to force it
Type    /sbin/insmod /tmp/ne.o io=0x300    (0x300 may be 0x320 0x340 ...)
That should do it


5.  I need help with the mkisofs command
I know what you mean.  Talk about switches.  Dont forget the final dot !!!!
mkisofs -o /tmp/final_iso_name.iso -R -V "Volume name or Label" -v -J -T -d -D -b original-image.img -c eltorito.boot -A "Application ID" .
Makes an ISO called final_iso_name.iso stored in the /tmp folder with a label "Volume name or Label" from original-image.img
If you run this command from a directory containing only the original-image.img, the final_iso_name.iso will contain original-image.img.
If you run this command from a directory containing the original-image.img and other files, the final_iso_name.iso will contain original-image.img and these other files !!
I hope that made sence

If you need more information, try the mkisofs man pages here



6.  I'd like to add my modified Partimage boot disk to the Partimage Bootable CD-ROM image.
I havent delved enough into this to figure this out under Linux (Yet)
Here is a quick way (for now) under Windows
You will need to use WinImage.  Get it here
Put your modified Partimage boot disk in your floppy drive.
Under Linux type    dd if=/dev/fd0 of=vmlinuz bs=1k    (Convert and copy /dev/fd0 to an image called vmlinuz with a 1k block size)
Alternatively you should be able to use RawWrite to do this under Windows Download it from here
This will make an exact image of your precious floppy called vmlinuz.
If you used RawWrite, ensure the final image name is vmlinuz
Now get your vmlinuz file over to your Windows box using whatever method you wish.  FTP, SCP ...
On your Windows box download the Partimage Bootable CD-ROM image.  Get it from here Look for "Bootable CD-Rom image (Eltorito) for Partition Image:"
You may want to try Mozilla since IE corrupt downloads alot
Open WinImage and use it to browse and open the Partimage Bootable CD-ROM image.  In my case partimage-0.6.1-i386-bootcd-3.img
Notice the file vmlinuz on the bottom!  That is the image of the boot disk
Use drag and drop to move your personal vmlinuz into the WinImage window
Say yes to do you want to inject ...
Say yes to do you want to replace ...
Now click the save button and exit
Great, the file partimage-0.6.1-i386-bootcd-3.img now has your customized partimage boot disk within it
Now, to convert this image to an ISO to burn to CD, refer to the documentation.



7.  I'm tired of using non-free software under MS.  What free/GNU/poscardware ... applications can I use instead
?
Ok so like here is the situation.  I am trying to move out of the MS world and into the GNU world.  Hey that was kinda funny.  I didnt even mean that.
Anyways, you are probably using Internet Explorer to browse the web, Easy (Coaster) CD creator or maybe Nero to burn CD's, Outlook Express to receive email viruses and spam ...
Like me, you are probably sitting in front of your GNU box saying what can I use instead?
I needed to make this list because I am finding so many choices.  (Open source really works)
Anyways, this list is really just a growing collection of GNU applications I found usefull for the stuff I do.
I hope I dont get flamed for forgetting someones app
Please forward me any apps you find really helpfull
Take care eh

Application Type
Application Name
Home Page
CD Ripping Software
grip  
http://nostatic.org/grip/
CD Burning Front Ends
See the list
http://sites.inka.de/~W1752/cdrecord/frontend.en.html
CD Burning Software
eroaster  (Eclipt Roaster)
http://eclipt.uni-klu.ac.at/
CD Burning Software
X CD roast
http://www.xcdroast.org/
CD Burning Software
CD Bake Oven
http://cdbakeoven.sourceforge.net/
CD/MP3/Ogg... Playing software
X Multimedia System
http://www.xmms.org/
Internet Browser
Mozilla
http://www.mozilla.org/
CD Ripping Software (Windows)
eac  (Exact Audio Copy)
http://www.exactaudiocopy.de/
CD Ripping Software (Windows) Makes Ogg files
oggdrop
http://www.vorbis.com/download_win.psp
A graphical front end for rdestkop
tsclient
http://www.gnomepro.com/tsclient/



8.  I have a Solaris box.  I want to reconfigure my IP address, host name, TZ, root password ... and start fresh.  What can I do?
#sys-unconfig
This single command will unconfigure the machine.
Upon rebootong you will be required to answer the same questions during a new installation


9.  I'd like to browse the solaris CD packages
#cd /cdrom/cdrom0
#cd Solaris_x
#cd Product
#pkgadd -d .


10.  On my Solaris 9 box I'd like to allow root ftp access

The file /etc/ftpd/ftpusers list the users not allowed to FTP
By default root is on this list
Delete or rem out (with a #) root to allow FTP access for this account
Be aware of the security risks (Clear text passwords with FTP)


11.  X11 connection rejected because of wrong authentication. Connection lost to X server.  I need help
In my case, this is what was hapenning
ssh -X user@remotebox
I Start an X11 using application &
Everything works great

Now I su to root (or another user)
Now, application & fails with;
X11 connection rejected because of wrong authentication. Connection lost to X server

This is not an ssh problem, but a simple result of root having a different .Xauthority file from the user you've ssh'ed in as.

A simple solution could be to use su -m

Here's a snip from the su man page
-m	Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made.
If this doesnt work for you, the a fix involves changing your environment variables

The fix however depends on your shell

CSH uses setenv, while SH uses export

Temporary Fixes
Here are some way to point roots XAUTHORITY variable to the working users environment variable
#setenv XAUTHORITY=userhome/.Xauthority
#export XAUTHORITY=userhome/.Xauthority

You could also use xauth merge to merge the two
#xauth merge /userhome/.Xauthority

Permanent fixes
Under FreeBSD I added this to /root/.cshrc
setenv XAUTHORITY /usr/home/steve/.Xauthority

I'll add to this as I hit this issue with other operating systems

Here some great references
CSH
setenv VARIABLENAME value_of_variable
The changes will come into effect the next time you login or invoke an instance of CSH
If you cannot wait that long, you can type source .cshrc to put the changes into effect immediately.
It can be useful to append to the end of an environment variable
This can be achieved using the following syntax at the command line and within .cshrc:
setenv VARIABLE ${VARIABLE}:value_to_append

SH
export VARIABLENAME=value_of_variable
The changes will remain in effect until you logout or invoke a new shell.
If you would like to change an environment variable permanently you should edit the file .profile and insert the line:
VARIABLE=value_of_variable
EXPORT VARIABLE
The changes will come into effect the next time you login or invoke an instance of SH
If you cannot wait that long, you can type . .profile to put the changes into effect immediately.
It can be useful to append to the end of an environment variable
This can be achieved using the following syntax from the command line:
EXPORT VARIABLE=$VARIABLE:value_to_append   
And from within .profile:
VARIABLE=$VARIABLE:value_to_append
EXPORT VARIABLE
This will append :value_to_append to the end of the current value of the variable.
In the example above the character ':' has been placed between ${VARIABLE} and value_to_append
This is not mandatory but has been included to illustrate that this type of setting of environment variables which appends to the variable is often used to add a
directory to a list of directories or a file to a list of files, when this is the case ':' is the standard separator used.


12.  How can I add Sun's Validation Test Suite (VTS) on my Solaris 9 for Sparc box?
Install Solaris 9 for Sparc
Choose Entire Distribution
FTP SUNWvts_5.1.tar.Z and SUNWvtsx_5.1.tar.Z to /var/spool/pkg
pkgadd SUNWvts SUNWvtsx
If they dont fit, put them in a directory (maybe root)
Type pkgadd -d .
cd /opt/SUNWvts/bin
./sunvts


13 .  I need help with command line SCP
Here's some scp command line examples

copy local file lfile to rfile on remote machine rsys
scp lfile rsys:rfile

copy local file lfile to rfile on remote machine rsys. Preserve modification time, access time  and mode from original
scp -p lfile rsys:rfile

copy local file lfile to rfile of user ruser on remote machine rsys
scp lfile ruser@rsys:rfile

copy local files lfile1 lfile2 to directory rdir on remote machine rsys
scp lfile1 lfile2 rsys:rdir

copy rfile from remote machine rsys to local file lfile
scp -p rsys:rfile lfile

copy local directory ldir to directory rdir on remote machine rsys, -r recursively copies entire directories
scp -r ldir rsys:rdir

copy remote file rfileA on remote machine rsysA to rfileB on remote machine rsysB
scp rsysA:fileA rsysB:rfileB

copy a number of files from a remote system to a specified directory locally:
scp rsys:\{a,b,c\} /ldir



Home           Back

If you find an error or wish to comment please let me know