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?
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?
I‘m using a Mac OS X and combination of ssh-agent+ssh-add to adds RSA or DSA identities to the authentication agent. ssh-agent provides me a secure way of storing the private key. However, I’d like to expire identities added to the agent within half an hour. How do I set lifetime of identities added to the agent under Unix / Linux / BSD / Apple OS X operating systems?
I‘m using scp command to copy files from one server to another server. The problem is that I’m unable to copy all hidden files (such as .bash_history). How do I copy hidden files using the scp command under Unix like operating systems?