redhat

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



Where,

=> $@ 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?

{ 1 comment }

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?

{ 7 comments }

/etc/shadow files stores actual password in encrypted format for user’s account. How do I check users password expiry information under Linux operating systems?

{ 2 comments }

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 192.168.1.1? Is there Linux, Unix, Apple OS X, or MS-Windows command that I can use get the same information?

{ 18 comments }

I want to find and edit my xorg.conf file for tweaking and configure it for new settings. The problem is that I’m unable to find the file. According to my research, xorg.conf should in /etc/X11 or /usr/X11R6/lib/X11/ directory. I found directories but not the file in directories. How do I find the xorg.conf under Unix or Linux like operating systems?

{ 1 comment }

I‘m trying to download an ISO image for Enterprise Linux from RHN or Novell Suse. Both providers have placed ISO images behind paywall. I need to provide authentication credentials before downloading all files. How do I download ISO files using the wget command with user name and password?

{ 8 comments }

I‘ve created the backup server using this tutorial under Redhat and Debian Linux systems. How do I restore files (such as /var/www/html) with rsnapshot backup tool? How do I restore MySQL database dumps with rsnapshot under UNIX or Linux operating systems?

{ 4 comments }