Bash: Print usage statement & exit; otherwise continue using Bash shorthand operators I want a short script to test for a commandline argument.

echo is one of the most commonly and widely used built-in command for Linux bash and C shells, that typically used in scripting language and batch files to display a line of text/string on standard output or a file. Referenced By The free command is the most simple and easy to use command to check memory usage on linux. 6 Responses to “Linux Mail Command Usage with Examples” Firstly, it is tremendously useful. The echo command is useful for conveying a message/information to user. The du command has many parameter options that can be used to get the results in many formats. If you need any further assistance please contact our support department. Input a line of text and… [[ This is a content summary only. 23 thoughts on “ Linux mail command examples – send mails from command line ” Angelo . If the info and echo programs are properly installed at your site, the command info coreutils aqecho invocationaq. should give you access to the complete manual. The Story Behind grep. It offers no formatting option. The Overflow Blog Podcast 235: An emotional week, and the way forward For most uses, printf is preferable. We have other command printf which is similar to […] This command is more useful when you are writing shell scripts then normal system administration use. The first two are bang on; the third is slightly off. $ echo “THIS IS A TEST EMAIL” | mail -s “Enter the subject” –r “Tom” –a /path/to/file user1@domain.com .

The full documentation for echo is maintained as a Texinfo manual. $ xargs -t abcd /bin/echo abcd abcd 7. In this post we will see some basic examples as well as advanced stuff to get most of it. May 10, 2020 at 6:06 pm $ mail -s “This is the subject” [email protected] <<< "This is the message" In the example above, using double quotes for the message, I can include $ variables. This script really helps system administrator to monitor their servers space usage. Based on the requirement , administrators […] The Linux xargs command may not be a hugely popular command-line tool, but this doesn't take away the fact that it's extremely useful, especially when combined with other commands like find and grep.If you are new to xargs and want to understand its usage, you'll be glad to know that's exactly what we'll be doing here. The Linux “du” (Disk Usage) is a standard Unix/Linux command, used to check the information of disk usage of files and directories on a machine.


It is a good command to display a simple output when you know that the variable's contents will not cause problems. It is one of the most important usage of xargs command. Combine Xargs with Find Command. The grep command is famous in Linux and Unix circles for three reasons.

Linux shell script to check /var logs space and send email if used space reach 80%. Also print space usage of each directory inside /var. Secondly, the wealth of options can be overwhelming.Thirdly, it was written overnight to satisfy a particular need. ... Use echo command to display a line of text or a variable value. When you need to find certain type of files and perform certain actions on them (most popular being the delete action). - If $1 is not present, then print a Usage statement and exit from the function. In this case, the command that xargs executes is “/bin/echo abcd”, which is displayed here. Here is a quick example $ free -m total used free shared buffers cached Mem: 7976 6459 1517 0 865 2248 -/+ buffers/cache: 3344 4631 Swap: 1951 0 1951 Useful to find out which folder use most of space under /var. Browse other questions tagged linux hard-drive usage disk-space-utilization or ask your own question. From Linux Shell Scripting Tutorial - A Beginner's handbook. The syntax for echo is: echo [option(s)] [string(s)] 1.

The du command also displays the files and directory sizes in a recursively manner.