Linux

Linux Tip: Getting rid of ^M

May 16, 2013
By
Linux Tip: Getting rid of ^M

How to get rid of ^M in text files using vi. :1,$ s’^M”g But how to get this ‘^M’ in the command line: Keep CTRL pressed  and then press v and m

Read more »

Linux Tip: Trimming the logs

April 25, 2013
By
Linux Tip: Trimming the logs

Various unix processes can produce fast growing logs that sometimes need to be trimmed instead of deleted, for reference or troubleshooting. And you likely have no desire to edit the files. Here is a handy ksh script that will quickly trim the log so it keeps recent information and lets you keep as many lines…

Read more »

Linux Tip: Banners on Telnet

April 19, 2013
By
Linux Tip: Banners on Telnet

For showing the banner on a telnet session. Add the following in /etc/inetd.conf telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b /etc/issue The -b option then the banner file after this allow inetd to reread the conf file by , inetd -c. After this you will be getting your banner on telnet session.

Read more »

Linux Tip: Killing more Users

April 17, 2013
By
Linux Tip: Killing more Users

To kill all processes of a particular user from root at unix prompt type: # kill -9 `ps -fu username |awk ‘{ print $2 }’|grep -v PID` We can also use the username as an argument and pass it from command line, if this command is put as a script.

Read more »

Linux Tip: Rename a large number of files

April 12, 2013
By
Linux Tip: Rename a large number of files

This a an oldie but a goodie. There always comes a time when a large number of files need to be renamed. Here is one quick way to do it: =================== cut here =========================== #!/bin/sh for i in * do echo $i mv $i `basename $i`.bak done

Read more »

Linux Tip: FTP Automated Transfer

April 11, 2013
By
Linux Tip: FTP Automated Transfer

Automatic file transfer through a script between machines using FTP. If one wants to transfer files between UNIX machines, here are the steps to follow. 1. The .netrc file a. create .netrc in the home directory. b. add this line machine login password e.g. machine abc.mydomain.com login deepak password deep123 c. chmod 600 .netrc 2.…

Read more »

Linux Tip: VI file reversal

April 10, 2013
By
Linux Tip: VI file reversal

I know…Enough of the file reversals already. We just really like this one and forgot about it until it was submitted.. A file reversal if you dont have tac or want to use a script. Edit the file in vi and type: :g/.*/m0

Read more »

Search

Advertisement

Affiliates

Featured Video

Translator

Links