How do you display last part of file in Unix?
NAME tail -- display the last part of a fileSYNOPSIS tail [-F | -f | -r] [-q] [-b number | -c number | -n number] [file ...]DESCRIPTION The tail utility displays the contents of file or, by...
View ArticleHow to sort the directories based on their sizes?
SolutionUse the du command with the sort command as $ du -s * | sort -rn747624 work23856 cards7040 postie680 convert120 thumbsThis will list the the size in bytes for the directories in...
View ArticleHow to find a list of files greater than a given size in Unix?
SolutionUse the find command with ls command to find a list of file in the current directory that are over 1000k or 1MB find . -size +1000k -print0 | xargs -0 ls -lShOutputread more
View ArticleHow to find out the DNS servers IP address in Unix?
AnswerIn order to find the DNS server address type following command as shell prompt:$ cat /etc/resolv.confOR$ less /etc/resolv.confOutputdomain hsd1.ca.comcast.net.nameserver 192.168.0.1
View ArticleWarning: mysql_connect(): [2002] No such file or directory
IssueWarning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/Mvohra/Sites/projects/webservices/apps/functions.php on line 8Warning:...
View ArticleWarning: mysql_connect(): [2002] No such file or directory
IssueWarning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/Mvohra/Sites/projects/webservices/apps/functions.php on line 8Warning:...
View ArticleHow perform global search and replace in vi?
SolutionUse the following command for global search & replace in the file::%s/search_string/replacement_string/gThis command tells vi to scan all lines in the file for search_string and change it...
View ArticleHow does a typical standalone Java program shell script look like?
#!/bin/shecho "########################################################"echo "Sample Run Script"echo "Copyright reserved Developerfeed.com@2010-2012!"echo...
View ArticleHow do you find about the system architecture of your Unix like machine?
AnswerRun the uname command via the terminal and see the outputread more
View ArticleHow to check if a port is open using Terminal in Unix?
There a couple of ways to find out.1) Using telnet to find if port is open on a remote/localhost using the command as:telnet hostname portnumberIf a port is open then there would be some output on the...
View Article