≡ Menu

apple os x

Linux / Unix: Find Out DNS Server IP Address / Names

How do I find out my DNS server IP address assiged my my ISP under Unix or Linux operating system using command prompt? How do I find preferred dns server under Debian / Ubuntu / Fedora Linux desktop system?
[click to continue…]

Linux / Unix rsync: Delete Source File After Transfer

I would like to move all desktop:~/Downloads/*.avi files from my desktop to laptop:~/Download/ using rsync. How do I delete source file after successful transfer is done using rsync command under BSD/Unix/Linux/Apple OS X operating systems?
[click to continue…]

Bash: Get The Last Argument Passed to a Shell Script

I'm writing a bash wrapper script that will pass arguments to the command. I need to find out the last argument if I call the wrapper as follows:

./wrapper -a -b --longarg=foo thisfilename.txt
./wrapper -a -b thisfilename.txt
./wrapper -a --next=true thisfilename.txt

=> $@ is all of them.
=> $0 is script name.
=> $1 is first arg.

I want thisfilename.txt stored in a shell variable called $last. How do I find the last argument passed to a shell script written in bash or ksh under Unix like operating systems?
[click to continue…]

Unix Copy Command Examples [ cp command ]

How do I copy files under Unix operating system using ksh or csh or bash shell prompt?
[click to continue…]

HowTo: Open a Tar.gz File In Linux / Unix

I've received a file called date.tar.gz. How do I open/extract/unpack a tar.gz file on Linux or Unix like operating systems using shell prompt?
[click to continue…]

Apple OS X: Remove a Symbolic Link (Symlink) Command

How do I remove a symlink under Apple Mac OS X using bash command line option?
[click to continue…]

Unix / Linux Shell: Get Third Field Separated by Forward Slash (/) Delimiter

I'm writing a shell script for automation purpose. The output the path of the current working directory is stored in $PWD or it can be obtained using the pwd command. How do I find out find out 3rd field separated by the forward slash (/) delimiter using $PWD under Unix like operating systems?
[click to continue…]

HowTo: Find Out DNS Server IP Address Used By My Router?

My router configured by ISP tech and it is set to get DNS server address automatically from upstream. Is there is a way to find out the IP address of the dns server used by my router which is located at Is there Linux, Unix, Apple OS X, or MS-Windows command that I can use get the same information?
[click to continue…]

HowTo: Set Readonly File Permissions On Linux / Unix

How do I set readonly permission for all files stored in /var/www/html directory?
[click to continue…]

Linux / Unix: Show Shares on NFS Server [ Shared Directories ]

We have a few netapp and other Unix server running here. An NFS server is configured on both netapp and Unix. How do I see all exported file systems from netapp and unix server using Linux command line option?
[click to continue…]