Sed to our rescue :)
1. Generating the file argument using "find" command :
find ./ -type f -exec sed -i 's/string1/string2/' {} \;
Thursday, 3 July 2008
Monday, 30 June 2008
Finding Out The Linux Distro and Version Info
Lot's of times we end up working on a system/server we don't know any thing about. So to be able to do more meaningful stuff, we need to find out what breed of Horses we are actually gonna race with.
1. The most basic way to do it would be to use "/PROC/" file system.
More specifically, the "version" file.
bash# cat /proc/version
Linux version 2.6.9-42.ELsmp (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:27:17 EDT 2006
2. Use "LSB" as fodder (Linux Standard Base)
bash# lsb_release -a
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Release: 4
Codename: NahantUpdate4
Currently, most of the major Linux distros (UBUNTU, RED HAT, Free BSD etc) comply with the LSB.
3. A not so popular way (which might not work on some distros like Free BSD) would be
bash# cat /etc/*-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
4. Again, using /etc , we can get
bash# cat /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Kernel \r on an \m
5. Using the boot up messages is another nifty way to get this info :
bash# dmesg | head -1
Linux version 2.6.9-42.ELsmp (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:27:17 EDT 2006
Well, am sure that there might be many more ways to find this info, and if you do know of them, do leave a comment and let me know about it. Each day I realize that there is much more learn/know, that I get even more keen to dwell further into this beast of a Linux.
1. The most basic way to do it would be to use "/PROC/" file system.
More specifically, the "version" file.
bash# cat /proc/version
Linux version 2.6.9-42.ELsmp (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:27:17 EDT 2006
2. Use "LSB" as fodder (Linux Standard Base)
bash# lsb_release -a
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Release: 4
Codename: NahantUpdate4
Currently, most of the major Linux distros (UBUNTU, RED HAT, Free BSD etc) comply with the LSB.
3. A not so popular way (which might not work on some distros like Free BSD) would be
bash# cat /etc/*-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
4. Again, using /etc , we can get
bash# cat /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Kernel \r on an \m
5. Using the boot up messages is another nifty way to get this info :
bash# dmesg | head -1
Linux version 2.6.9-42.ELsmp (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:27:17 EDT 2006
Well, am sure that there might be many more ways to find this info, and if you do know of them, do leave a comment and let me know about it. Each day I realize that there is much more learn/know, that I get even more keen to dwell further into this beast of a Linux.
Sunday, 13 January 2008
NFS Server Not Responding
Incase you are able to connect to the NFS server, and able to mount using , for example ,say :
mount -t nfs -o nolock 10.88.27.76:/home/jayant /mnt
And are further able to access the FS as well (able to view directories and files), but any attempt to try and execute or access any big file (like "insmod"ing a kernel object, or executing helloworld executable) results in the heinous "NFS server not responding" error,i.e., something like the following:
nfs: server 10.88.27.76 not responding, still trying
,then try to increase the rsize to the maximum permissible value (in my case, 8192 bytes)...This might help...So, instead of cmd1, try the following command to mount :
mount -t nfs -o nolock,rsize=8192 10.88.27.76:/home/jayant /mnt
mount -t nfs -o nolock 10.88.27.76:/home/jayant /mnt
And are further able to access the FS as well (able to view directories and files), but any attempt to try and execute or access any big file (like "insmod"ing a kernel object, or executing helloworld executable) results in the heinous "NFS server not responding" error,i.e., something like the following:
nfs: server 10.88.27.76 not responding, still trying
,then try to increase the rsize to the maximum permissible value (in my case, 8192 bytes)...This might help...So, instead of cmd1, try the following command to mount :
mount -t nfs -o nolock,rsize=8192 10.88.27.76:/home/jayant /mnt
Subscribe to:
Comments (Atom)