Archive for bash commands

ncftp usage

ncftp -R -u username -p password destination host/ip /destination folder/ /source folder/*

Read more

how to use grep

grep is a unix command that allows you to search for a pattern in a list of files
You use grep in the following manner:
grep pattern file-name1 file-name2
Here is an example:
bash % grep ‘bizante news’ /usr/local/news/2009/*
/usr/local/news/2009/ - is the directory we are searching
* – the star in this case is saying that you want the search to [...]

Read more

display partition size and free space

Using the df bash command to display partition size and free space
df -h -x tmpfs
(the addidtional paramerters after the df are only for visibility)
If one of your partitions is short of space you can move a large sized folder to a partition with lots of free space and create a symbolic link to it.
mv /oldfolder [...]

Read more

Use Linux Find and Awk to Locate Large Files

This is a handy little bash command for locating large file on your linux box.
find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $NF “: ” $5 }’

Read more

wget command

It is a common practice to manage UNIX/Linux/BSD server remotely over ssh
session.
As you manage servers, you need to download the software or other files.
When it comes to command line (shell prompt) wget the non-interactive downloader rules.
It supports http, ftp, https protocols along with authentication.
Download a single file using wget
$ wget http://www.domain.com/filename.gz
Force wget to download all [...]

Read more