I wanted to transfer some files from Windows to Unix using FileZilla, but the problem arises when these files are transferred (Ascii or Binary mode both) and opened using VI we get ^M characters, also known as CTRL-M characters. I searched about this but the solutions were to remove these ^M characters when files are transferred using utilities. Is there any way that these ^M characters do not appear in the first place? Well, my search continues but I will share the solution which worked for me for removing control M characters i.e. CTRL-M or ^M characters. There are several UNIX commands e.g. dos2unix which can be used to convert a Windows or DOS generated files to UNIX one. You can also use sed command (stream editor) to remove CTRL-M characters without opening the file, very useful if you are removing CTRL-M characters from a large file. Alternatively, you can use VI command to open the file and replace ^M characters with nothing.
Read more »
Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts
Saturday, 24 September 2016
Thursday, 2 June 2016
10 Example of lsof commands in UNIX and Linux
It's been a long time I have written anything on UNIX or Linux, but today I'll talk about the lsof command, a utility command every system admin and developer love. The lsof command stands for list open file descriptors and as the name suggest, it is used to find open files by process. Since almost everything in UNIX are file, you can use lsof command to find an open regular file, a directory, a symbolic link, a block special file, a NFS mounted file, a socket stream, a shared library, a character special file, a regular pipe, a named pipe, an internet socket, a UNIX domain socket and many others. It's an incredibly useful tool to do debugging and troubleshooting in UNIX and Linux environment. Since most of the production system runs on the UNIX-based operating system, knowledge of this tool become even more important.
Read more »
Tuesday, 22 March 2016
Top 10 basic networking commands in linux/unix
Networking is an essential part Unix and it offer lots of tools and command to diagnose any networking problem. When I was working on FIX Protocol we get a lot of support queries to see whether FIX Sessions are connected or not. Since FIX Protocol uses sockets you can use the netstat , telnet and other networking commands available in Linux for finding a problem and solve that.In this article, I will show you basic networking commands in Unix and for what purpose they are used. with the combination of grep and find command on them, you can troubleshoot most of the networking problem.
Read more »
Location:
United States
Saturday, 23 January 2016
10 Example of find command in Unix and Linux
The find command is one of the versatile commands in UNIX and Linux and I used it a lot in my day to day work. I believe having good knowledge of find command in UNIX and understanding of its different options and usage will increase your productivity a lot in UNIX based operating system e.g. Redhat Linux or Solaris. If you are a QA, support personnel, and your works involve lots of searching text on Linux machine or if you are a Java or C++ programmer and your code resides in UNIX, find command can greatly help you to look for any word inside your source file in the absence of an IDE. It is the alternative way of searching things in UNIX, grep is another Linux command which provides similar functionality like find but in my opinion later is much more powerful than grep in UNIX.
Location:
United States
Sunday, 17 January 2016
10 examples of grep command in UNIX and Linux
grep command is one of the most frequently used UNIX command stands for "Global Regular Expression Print" like find, chmod or tar command in Unix. grep command in Unix operating system e.g. Linux, Solaris, BSD, Ubuntu or IBM AIX is used to search files for matching patterns, by using grep command in Unix you can search a file which contains a particular word or particular pattern. UNIX grep command also provides several useful command line option which can be used to enhance the functionality of grep command e.g. by using grep -v you can list down all files which don't contain a word i.e. excluding files which matches a pattern, grep -c will print count of matching pattern in a file etc. One of the popular examples of grep command is to find empty files and directories in Unix.
Read more »
Location:
United States
Subscribe to:
Posts (Atom)