Search Results for: ftp

Linux tee command explained with examples

Introduction We may often find ourselves in situations wherein we are running some commands on our Linux/UNIX operating system and we need to display the output of the command to our terminal and save it to a file for future use as well. The Linux tee command is a utility that is meant to be used for precisely this purpose. We have already provided a quick introduction to the tee command in one of our earlier articles. In this article, we will discuss the different ways in which we could use the tee command in greater detail by means of practical examples. The tee command is part of the coreutils package and therefore should be installed on almost every Linux distribution out there. We’ll be using a Centos 6 machine for demonstrating the examples in this article. Example 1: Using tee command directly For our first and basic example, we’ll type the tee command followed by a file name and press enter. From hereon in anything we type on the terminal is redirected back to the terminal in the form of stdout and redirected to the file whose name we specified while invoking the tee command. Here is a demonstration. [root@linuxnix ~]# tee myfile.txt this is a basic tee command usage example this is a basic tee command usage example [root@linuxnix ~]# [root@linuxnix ~]# cat myfile.txt this is a basic tee...

Read More

wget download a file to a directory in Linux/Unix

Wget(Website get) is a Linux command line tool to download any file which is available through a network which has a hostname or IP address. With wget command we can download from an FTP or HTTP site as this supports many protocols like FTP, HTTP, https, ftps etc. By default wget command downloads files to the present working directory where you execute the command. This is a bit annoying as we have to move the downloaded file to a specific folder or we have to go the directory where you want that file downloaded and use wget command. In this post, we will see how to download to a specific location in the system. wget command syntax: wget <URL> To get downloaded file to a specific directory we should use -P or –directory-prefix=prefix. From wget man pages.        -P prefix        --directory-prefix=prefix            Set directory prefix to prefix.  The directory prefix is the directory where all other files and subdirectories will be saved to,            i.e. the top of the retrieval tree.  The default is . (the current directory). The syntax for downloading to a specific directory. wget -P <path> <URL> Example: wget -P /opt/mykernel/ https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.13.tar.xz Output: wget -P /opt/mykernel/ https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.13.tar.xz --2018-06-02 17:56:52--  https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.13.tar.xz Resolving cdn.kernel.org... 151.101.1.176, 151.101.65.176, 151.101.129.176, ... Connecting to cdn.kernel.org|151.101.1.176|:443... connected. HTTP request sent, awaiting response......

Read More

Using multitail utility to monitor log files

Introduction The ability to effectively understand and monitor log files is an important part of a system administrator or developer’s job responsibilities. Since, while working with Linux systems when services and applications do not function as intended the first and foremost task to look through the log files for diagnostic information that could help in troubleshooting the issue. We could you the cat command to open up the log file and print it to the terminal in its entirety but a large log file would be difficult to read if opened is this manner. If we need to view the oldest or most recent logs from a file, we could use the head and tail commands respectively. A more effective method of reading large log files would be to parse it through pagers more and less. But what if we need to monitor the log file for changes in real time?  The inbuilt tail command has proven useful in this aspect by providing a -f option which allows users to monitor log files for changes/content as it gets appended to log file. But in order to monitor log files really effectively, we should consider using the multitail utility which is a free and open source tool developed to help users monitor their system log files. Given below are some of the features of multitail and why you should consider...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.