1) Uncompress the downloaded patch set file into a new directory and extract the zip files using the following commands:
unzip p4163445_9207_AIX64-5l.zip
2) Uncompress the downloaded patch set file into a new directory and extract the cpio files using the following commands:
cpio -idcv < 9205_aix5164_release.cpio
3) Uncompress the downloaded patch set file into a new directory and extract the tar files using the following commands:
tar xvf 8174_aix32.tar
Wednesday, August 26, 2009
Wednesday, August 12, 2009
Moving directories and files recursively
I have a directory with 3 subdirectories.
for example dir1, dir2 and dir3
/home/mydirectory/
dir1
dir2
dir3
under these directory I have 3 subdirectories and I would like to move or copy all the subdirectories of
/home/mydirectory to /home/movehere/
Unfortenately a normal move moves also mydirectory to /home/movehere
and so I get /home/movehere/mydirectory
This is not what I want, I just want all the subdirectories of mydirectory.
This is what I need:
home/movehere/
dir1
dir2
dir3
Option#1
--------
#!/bin/sh
cd /home/mydirectory
echo dir* | while read LINE
do
if [ -d $LINE ]; then
mv $LINE /home/movehere
fi
done
Option#2 (Proper way)
--------
The proper way to do it, is to use tar to copy files from one directory to another:
# all on oneline
cd /home/mydir; tar cf - .|(cd /home/movehere; tar xf - )
You can also use cpio:
# all on oneline
cd /home/mydir; find . -depth -print|cpio -pd /home/movehere
Thanks to http://www.computing.net/answers/unix/moving-recursively-direcotries/6930.html
for example dir1, dir2 and dir3
/home/mydirectory/
dir1
dir2
dir3
under these directory I have 3 subdirectories and I would like to move or copy all the subdirectories of
/home/mydirectory to /home/movehere/
Unfortenately a normal move moves also mydirectory to /home/movehere
and so I get /home/movehere/mydirectory
This is not what I want, I just want all the subdirectories of mydirectory.
This is what I need:
home/movehere/
dir1
dir2
dir3
Option#1
--------
#!/bin/sh
cd /home/mydirectory
echo dir* | while read LINE
do
if [ -d $LINE ]; then
mv $LINE /home/movehere
fi
done
Option#2 (Proper way)
--------
The proper way to do it, is to use tar to copy files from one directory to another:
# all on oneline
cd /home/mydir; tar cf - .|(cd /home/movehere; tar xf - )
You can also use cpio:
# all on oneline
cd /home/mydir; find . -depth -print|cpio -pd /home/movehere
Thanks to http://www.computing.net/answers/unix/moving-recursively-direcotries/6930.html
Monday, August 10, 2009
Sharing folders between Windows and Linux using Samba
LINUX : Mounting Shared Windows folders on Linux
Here are the steps in order to get SMB / SAMBA configured on the Linux host to see a windows shared path:
1. Check if you have the necessary packages, commands and daemons running. (If you get command not found or No such file or directory, you’ll need to install these prior to going further with the installation.)
Run the below to check if chkconfig and the SAMBA RPM’s are installed:
# which chkconfig
/sbin/chkconfig
# rpm -aq|egrep -i "smb|samba"
.
samba-client-3.3.2-0.33.fc11.i586
.
If anyone is missing, you can use:
# nice -n 19 yum search samba
to get a list of available packages to install from.
Check if the smb daemon is installed:
# chkconfig –list smb
smb 0:off 1:off 2:off 3:off 4:off 5:on 6:off
#
If nothing comes back other then the prompt, check if the service exists:
# ls -al /etc/init.d/smb
-rwxr-xr-x 1 root root 1745 2009-03-26 16:49 /etc/init.d/smb
#
and enable it in this manner:
# chkconfig –add smb 5
to add it to run level 5 (Linux GUI stage). Samba comes with an comprehensive set of commands to choose from. Those most important to this post are enbolded:
/usr/bin/findsmb
/usr/bin/mksmbpasswd.sh
/usr/bin/smbcacls
/usr/bin/smbclient
/usr/bin/smbcontrol
/usr/bin/smbcquotas
/usr/bin/smbencrypt
/usr/bin/smbget
/usr/bin/smbpasswd
/usr/bin/smbprint
/usr/bin/smbspool
/usr/bin/smbstatus
/usr/bin/smbtar
/usr/bin/smbtree
To find out version of package owning above files use:
# rpm -qf /usr/bin/smbclient
samba-client-3.3.2-0.33.fc11.i586
#
Finally, you can use:
# ps -ef |grep smbd
root 2026 1 0 Jul23 ? 00:00:00 smbd -D
root 2046 2026 0 Jul23 ? 00:00:00 smbd -D
root 14524 2026 0 Jul25 ? 00:00:00 smbd -D
#
to ensure it is in fact running.
If the daemon is not running you can restart it by running:
# service smb restart
OR
# /etc/init.d/smb restart
2. Share a folder on the Windows PC so it is visible. Before you can access the remote folders through Linux, they need to be shared first on the remote Windows PC.
• In Windows, right click on the start button then choose
Explore
OR
Explore All Users
• Browse to or create a folder you would like to share such as D:\HomeVideos or C C:\HomeVideos etc.
• Right click the folder then select Properties… from the pop up menu. On the popup menu select the Sharing tab. You should see this panel:

Ensure:
• Share this folder on the network is checked.
• Share name: is set to either the default value or you can type your preference.
• If you would like others to modify files on this disk, select Allow network users to change my files. This will depend on whether you need to let others modify files there and the who will have access to it.
You will notice that after you do this there will now be a blue hand under that folder indicating it is shared:
as opposed to:
for non shared folders.
3. On Linux, verify that the remote Windows machine shares are visible.
For this, we wil use the smbclient command like this:
# smbclient -L sgwapp2 or 192.168.7.10
Enter root’s password: No Password (Just press return)
4. Mount the remote Windows shared drives and access them as if any UNIX folder.
Create a mount folder then use the mount command to mount the shared drive:
# mkdir /mnt/sgwapp2_Zetatech
# mount -t cifs "//192.168.7.10/zetatech" "/mnt/sgwapp2_zetatech" \
-ouser=sa_backup,pass=backup_now,domain=SCRRA,rw
though even depending on permissions and setup, the default anonymous user should work (see further down):
# mount -t cifs "//192.168.7.10/zetatech" "/mnt/sgwapp2_zetatech"
Test the drive by navigating to it and creating a test file:
# cd /mnt/zetatech
# touch test-file.txt
On your Windows system, check that the test-file.txt exists and remote it. This simulates a short read and write test on both systems.
Thanks to microdevsys.
Here are the steps in order to get SMB / SAMBA configured on the Linux host to see a windows shared path:
1. Check if you have the necessary packages, commands and daemons running. (If you get command not found or No such file or directory, you’ll need to install these prior to going further with the installation.)
Run the below to check if chkconfig and the SAMBA RPM’s are installed:
# which chkconfig
/sbin/chkconfig
# rpm -aq|egrep -i "smb|samba"
.
samba-client-3.3.2-0.33.fc11.i586
.
If anyone is missing, you can use:
# nice -n 19 yum search samba
to get a list of available packages to install from.
Check if the smb daemon is installed:
# chkconfig –list smb
smb 0:off 1:off 2:off 3:off 4:off 5:on 6:off
#
If nothing comes back other then the prompt, check if the service exists:
# ls -al /etc/init.d/smb
-rwxr-xr-x 1 root root 1745 2009-03-26 16:49 /etc/init.d/smb
#
and enable it in this manner:
# chkconfig –add smb 5
to add it to run level 5 (Linux GUI stage). Samba comes with an comprehensive set of commands to choose from. Those most important to this post are enbolded:
/usr/bin/findsmb
/usr/bin/mksmbpasswd.sh
/usr/bin/smbcacls
/usr/bin/smbclient
/usr/bin/smbcontrol
/usr/bin/smbcquotas
/usr/bin/smbencrypt
/usr/bin/smbget
/usr/bin/smbpasswd
/usr/bin/smbprint
/usr/bin/smbspool
/usr/bin/smbstatus
/usr/bin/smbtar
/usr/bin/smbtree
To find out version of package owning above files use:
# rpm -qf /usr/bin/smbclient
samba-client-3.3.2-0.33.fc11.i586
#
Finally, you can use:
# ps -ef |grep smbd
root 2026 1 0 Jul23 ? 00:00:00 smbd -D
root 2046 2026 0 Jul23 ? 00:00:00 smbd -D
root 14524 2026 0 Jul25 ? 00:00:00 smbd -D
#
to ensure it is in fact running.
If the daemon is not running you can restart it by running:
# service smb restart
OR
# /etc/init.d/smb restart
2. Share a folder on the Windows PC so it is visible. Before you can access the remote folders through Linux, they need to be shared first on the remote Windows PC.
• In Windows, right click on the start button then choose
Explore
OR
Explore All Users
• Browse to or create a folder you would like to share such as D:\HomeVideos or C C:\HomeVideos etc.
• Right click the folder then select Properties… from the pop up menu. On the popup menu select the Sharing tab. You should see this panel:

Ensure:
• Share this folder on the network is checked.
• Share name: is set to either the default value or you can type your preference.
• If you would like others to modify files on this disk, select Allow network users to change my files. This will depend on whether you need to let others modify files there and the who will have access to it.
You will notice that after you do this there will now be a blue hand under that folder indicating it is shared:
as opposed to:
for non shared folders.
3. On Linux, verify that the remote Windows machine shares are visible.
For this, we wil use the smbclient command like this:
# smbclient -L sgwapp2 or 192.168.7.10
Enter root’s password: No Password (Just press return)
4. Mount the remote Windows shared drives and access them as if any UNIX folder.
Create a mount folder then use the mount command to mount the shared drive:
# mkdir /mnt/sgwapp2_Zetatech
# mount -t cifs "//192.168.7.10/zetatech" "/mnt/sgwapp2_zetatech" \
-ouser=sa_backup,pass=backup_now,domain=SCRRA,rw
though even depending on permissions and setup, the default anonymous user should work (see further down):
# mount -t cifs "//192.168.7.10/zetatech" "/mnt/sgwapp2_zetatech"
Test the drive by navigating to it and creating a test file:
# cd /mnt/zetatech
# touch test-file.txt
On your Windows system, check that the test-file.txt exists and remote it. This simulates a short read and write test on both systems.
Thanks to microdevsys.
Subscribe to:
Posts (Atom)