<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ExpertsLogIn</title>
	<atom:link href="http://www.expertslogin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.expertslogin.com</link>
	<description>Linux / Open Source Online Resources</description>
	<lastBuildDate>Thu, 23 May 2013 19:52:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Shell Script To Run Commands In Users Home Directory</title>
		<link>http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/</link>
		<comments>http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/#comments</comments>
		<pubDate>Wed, 22 May 2013 20:43:59 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX SHELL SCRIPT]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4945</guid>
		<description><![CDATA[<p>Shell script that run linux commands in all users home directories and outputs its results. Scripts accepts user name and command as the argument. Shell Script #Next line tell with shell to use #!/bin/bash #we store in variable path to file UserListFile=/tmp/user.list #We create function with name Usage Usage () { #printing help echo &#8220;$0 [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/shell-script-create-linux-user/"     class="crp_title">Interactive Linux Shell Script To Create New Linux User</a></li><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/script-check-service-up/"     class="crp_title">Shell Script : Service Status Check And start If It&#8217;s&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/delete-duplicate-files/"     class="crp_title">Shell Script To Delete Duplicate Files</a></li><li><a href="http://www.expertslogin.com/shell-script-2/monitor-ftp-server/"     class="crp_title">Shell Script To Monitor Ftp Server Connection</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/">Shell Script To Run Commands In Users Home Directory</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Shell script that run linux commands in all users home directories and outputs its results. Scripts accepts user name and command as the argument.</p>
<h2>Shell Script</h2>
<blockquote><p>#Next line tell with shell to use<br />
#!/bin/bash</p>
<p>#we store in variable path to file<br />
UserListFile=/tmp/user.list</p>
<p>#We create function with name Usage<br />
Usage () {</p>
<p>#printing help<br />
    echo &#8220;$0 &#8211; execute command in all HOME directories</p>
<p>usage: $0 [-a] command [arg ...]</p>
<p>    -a:  process HOME directories of all users</p>
<p>The given command will be executed with the arguments specified in the</p>
<p>home directory of users.</p>
<p>&#8221;</p>
<p>#exit from program<br />
    exit 1</p>
<p>#end of function<br />
}</p>
<p>#we check if there less than 1 parameter<br />
if [ $# -lt 1 ]</p>
<p>then</p>
<p>#if less – print help<br />
    Usage</p>
<p>#in other case<br />
else</p>
<p>#we check passed parameters, starting from first<br />
    case &#8220;$1&#8243; in</p>
<p>#if parameter -a then we write to All variable value true<br />
	-a)	All=true</p>
<p>#removing parameter<br />
		shift ;;</p>
<p>#if parameter starting with -, and not -a, we print help<br />
	-*)	Usage ;;</p>
<p>#exit from case<br />
    esac</p>
<p>#exit from fi loop<br />
fi</p>
<p>#we check if user pass -a as parameter<br />
if [ "$All" = true ]</p>
<p>#if -a passed<br />
then</p>
<p>#we get list of all users<br />
	cat /etc/passwd | cut -d&#8217;:&#8217; -f1 | sed -e &#8216;s/:/ /g&#8217; > $UserListFile</p>
<p># in other case<br />
else</p>
<p>#print message<br />
	echo &#8220;Please enter users, type [ to exit"</p>
<p>#cleaning file with userlist<br />
	echo -n > $UserListFile</p>
<p>#starting while loop to read users<br />
	while read UserName Rest</p>
<p>	do</p>
<p>#if user print [ to exit loop<br />
	if [ $UserName = "[" ]; then</p>
<p>#exit from loop<br />
		break</p>
<p>#if user print other data<br />
	else<br />
#we check if user put any symbol</p>
<p>		test -z &#8220;$UserName&#8221; &#038;&#038; continue<br />
#we check if user exist<br />
		grep &#8220;^$UserName&#8221; /etc/passwd > /dev/null || {</p>
<p>#if not exist print message to user<br />
		echo &#8220;Can&#8217;t find user ${UserName}; ignored.&#8221;</p>
<p>#we continue loop<br />
		continue</p>
<p>		}</p>
<p>#if user exist – we store it to userfile<br />
		echo $UserName >> $UserListFile	</p>
<p>#exit of if loop<br />
	fi</p>
<p>#exit from reading user input<br />
	done</p>
<p>#exit from if loop<br />
fi</p>
<p>#just print empty line<br />
echo &#8220;&#8221;</p>
<p>#stop all other parameters as command we need to run<br />
Command=&#8221;$@&#8221;</p>
<p>#getting list of users<br />
UserList=`cat $UserListFile`</p>
<p>#getting user one by one from list<br />
for user in ${UserList}</p>
<p>do</p>
<p>#one more empty line<br />
	echo &#8220;&#8221;</p>
<p>#getting user home directory<br />
	HomeDir=`grep &#8220;^$user&#8221; /etc/passwd | cut -d&#8221;:&#8221; -f6`</p>
<p># we check if we have read and execute permissions to cd and run command<br />
	[ -r "$HomeDir" -a -x "$HomeDir" ] || {</p>
<p># if not just warn user<br />
	echo &#8220;Read or execute of folder $HomeDir denied&#8221;</p>
<p>	continue</p>
<p>#exit of check<br />
	}</p>
<p>#we telling user about what command we run and inside what directory<br />
	echo &#8220;Runnig $Command inside $HomeDir&#8221;</p>
<p>#entering home<br />
	cd $HomeDir</p>
<p>#running command<br />
	$Command</p>
<p>done<br />
#cleaning, removing temp files<br />
rm -rf $UserListFile</p></blockquote>
<h2>Sccript Output</h2>
<blockquote><p>./exec_home.sh ls</p>
<p>Please enter users, type exit to exit</p>
<p>sshd</p>
<p>yevhen</p>
<p>exit</p>
<p>Runnig ls     inside /var/run/sshd</p>
<p>Runnig ls     inside /home/yevhen</p>
<p>Desktop    Downloads  examples.desktop	Pictures  Templates</p>
<p>Documents  Dropbox    Music		Public	  Videos</p></blockquote>
<p><a href="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png"><img src="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png" alt="shell script run command home directory" width="250" height="200" class="aligncenter size-full wp-image-4241" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/shell-script-create-linux-user/"     class="crp_title">Interactive Linux Shell Script To Create New Linux User</a></li><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/script-check-service-up/"     class="crp_title">Shell Script : Service Status Check And start If It&#8217;s&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/delete-duplicate-files/"     class="crp_title">Shell Script To Delete Duplicate Files</a></li><li><a href="http://www.expertslogin.com/shell-script-2/monitor-ftp-server/"     class="crp_title">Shell Script To Monitor Ftp Server Connection</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/">Shell Script To Run Commands In Users Home Directory</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Script To Delete Duplicate Files</title>
		<link>http://www.expertslogin.com/shell-script-2/delete-duplicate-files/</link>
		<comments>http://www.expertslogin.com/shell-script-2/delete-duplicate-files/#comments</comments>
		<pubDate>Sun, 19 May 2013 22:00:29 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX SHELL SCRIPT]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4937</guid>
		<description><![CDATA[<p>Shell Script is looking for duplicated names in files withing sub-directories, and after check md5sum. If md5sum of the files same then we conclude its duplicated. This helps system administrator to delete unnecessary copy to reduce used space. Script also ask user to enter directory where to search, and check if input is empty. Shell [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/older-files-delete/"     class="crp_title">Shell Script : Find Files Older X Days And Ask User To&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/shell-script-create-linux-user/"     class="crp_title">Interactive Linux Shell Script To Create New Linux User</a></li><li><a href="http://www.expertslogin.com/shell-script-2/monitor-ftp-server/"     class="crp_title">Shell Script To Monitor Ftp Server Connection</a></li><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/shell-script-2/delete-duplicate-files/">Shell Script To Delete Duplicate Files</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Shell Script is looking for duplicated names in files withing sub-directories, and after check md5sum. If md5sum of the files same then we conclude its duplicated. This helps system administrator to delete unnecessary copy to reduce used space. Script also ask user to enter directory where to search, and check if input is empty.</p>
<h2>Shell Script</h2>
<blockquote><p>#!/bin/bash</p>
<p>#file, where we will store full list of files.<br />
ListOfFiles=/tmp/listoffiles.txt</p>
<p>#we ask user to enter directory where search for duplicated files<br />
echo -n &#8220;Please enter directory where to search for duplicated files: &#8221;</p>
<p>#we read user input<br />
while read dir</p>
<p>do</p>
<p>#we check if user input is not empty<br />
        test -z &#8220;$dir&#8221; &#038;&#038; {</p>
<p>#if user input empty we ask once more to enter directory<br />
        echo -n &#8220;Please enter directory: &#8221;</p>
<p>        continue</p>
<p>        }</p>
<p>#if directory entered, exit from while loop<br />
        break</p>
<p>done</p>
<p>#getting list of files inside entered directory<br />
find $dir -type f -print > $ListOfFiles</p>
<p>#writing list of files to variable<br />
FileList=`cat $ListOfFiles`</p>
<p>#we get number of files<br />
count=`wc -l $ListOfFiles| awk &#8216;{print $1}&#8217;`</p>
<p>#counter<br />
i=1</p>
<p>#we get files one by one<br />
for file in $FileList</p>
<p>do</p>
<p>#just make this variable empty for every loop<br />
	samefiles=&#8221;"</p>
<p>#we need to get all non-proceeded files<br />
	let tailvalue=$count-$i</p>
<p>#we get only filename, without path<br />
	filename=$(basename $file)</p>
<p>#getting list of un-proceeded files, and we check if there is file with same filename<br />
	samefiles=`tail -${tailvalue} $ListOfFiles | grep $filename`</p>
<p>#starting loop for all same files<br />
	for samefile in $samefiles </p>
<p>	do</p>
<p>#we get md5sum of filename with same name<br />
		msf=`md5sum $samefile | awk &#8216;{print $1}&#8217;`</p>
<p>#we get md5sum of original file<br />
		ms=`md5sum $file | awk &#8216;{print $1}&#8217;`</p>
<p>#we compare md5sums<br />
		if [ "$msf" = "$ms" ]; then</p>
<p>#if md5sums equal, we tell user about duplicated files<br />
			echo &#8220;File $file duplicated to $samefile&#8221;</p>
<p>#end of if loop<br />
		fi</p>
<p>#end of while loop<br />
	done</p>
<p>#increase counter by 1<br />
	let i=$i+1</p>
<p>done
</p></blockquote>
<h2>Script Output</h2>
<blockquote><p>./finddup.sh </p>
<p>Please enter directory where to search for duplicated files: /tmp</p>
<p>File /tmp/1/user.list duplicated to /tmp/user.list
</p></blockquote>
<p><a href="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png"><img src="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png" alt="shell script delete duplicate files" width="250" height="200" class="aligncenter size-full wp-image-4241" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/older-files-delete/"     class="crp_title">Shell Script : Find Files Older X Days And Ask User To&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/shell-script-create-linux-user/"     class="crp_title">Interactive Linux Shell Script To Create New Linux User</a></li><li><a href="http://www.expertslogin.com/shell-script-2/monitor-ftp-server/"     class="crp_title">Shell Script To Monitor Ftp Server Connection</a></li><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/shell-script-2/delete-duplicate-files/">Shell Script To Delete Duplicate Files</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/shell-script-2/delete-duplicate-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Script To Find Directories Which Consume Highest Space</title>
		<link>http://www.expertslogin.com/shell-script-2/directories-consume-space/</link>
		<comments>http://www.expertslogin.com/shell-script-2/directories-consume-space/#comments</comments>
		<pubDate>Thu, 16 May 2013 07:37:08 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX SHELL SCRIPT]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4918</guid>
		<description><![CDATA[<p>Shell script to show X number of directories that consume space in a path. This script useful if user need quickly to clean up space, so first user need to check what directory take most of space and the delete according to your wish. Commands used are du with different keys , then sort and [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/older-files-delete/"     class="crp_title">Shell Script : Find Files Older X Days And Ask User To&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/find-rar-unrar/"     class="crp_title">Shell Script : Find All Zip / Rar Files Then Unzip / Unrar</a></li><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/check-disk-usage-is-out-of-space/"     class="crp_title">Shell Script To Check Disk Usage Is Out Of Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/login-logout-scripts/"     class="crp_title">Linux Login Logout Scripts To Send Email</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/">Shell Script To Find Directories Which Consume Highest Space</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Shell script to show X number of directories that consume space in a path. This script useful if user need quickly to clean up space, so first user need to check what directory take most of space and the delete according to your wish.</p>
<p>Commands used are du with different keys , then sort and head commands.</p>
<h2>Shell script</h2>
<blockquote><p>#/bin/bash</p>
<p>#check if user input argument</p>
<p>if [ $# -eq 0 ]; then</p>
<p>#if no argument print next messge and exit from script<br />
	echo &#8220;Usage: $0 <Directory> <Number of directories>&#8221;</p>
<p>exit 1</p>
<p>fi<br />
# Save first arguments to variables<br />
CheckedDir=&#8221;$1&#8243;<br />
 #<br />
HeadValue=$2<br />
#set value for variable count value 1<br />
  count=1</p>
<p>#just print empty line<br />
  echo &#8220;&#8221;</p>
<p>#Print next message:<br />
  echo &#8220;Here is the ${HeadValue} biggest directories located in ${CheckedDir}:&#8221;</p>
<p>  echo &#8220;&#8221;</p>
<p>#Getting list of directories and space they use.<br />
  du -a &#8211;max-depth=1 &#8211;one-file-system  ${CheckedDir}/ |</p>
<p>#next we sort result<br />
  sort -rn |</p>
<p>  sed &#8220;1d&#8221; |</p>
<p># next we get only first X directories<br />
  head -&#8221;${HeadValue}&#8221; |</p>
<p>#next print result to user<br />
  while read size dirrr ; do<br />
#counting size in Mb</p>
<p>      size=&#8221;$(( size / 1024 ))&#8221;</p>
<p>#show output for user<br />
      echo &#8220;N°${count} : ${dirrr} is ${size} Mb&#8221;</p>
<p>      ((count++))</p>
<p>  done</p>
<p>  echo &#8220;&#8221;
</p></blockquote>
<h2>Script Output</h2>
<blockquote><p>./top5dir.sh /home/yevhen/</p>
<p>Here is the  biggest directories located in /home/yevhen/:</p>
<p>N°1 : /home/yevhen//Fly is 14043 Mb</p>
<p>N°2 : /home/yevhen//VirtualBox VMs is 5837 Mb</p>
<p>N°3 : /home/yevhen//Downloads is 2224 Mb</p>
<p>N°4 : /home/yevhen//.icedove is 963 Mb</p>
<p>N°5 : /home/yevhen//Downloads is 645 Mb</p>
<p>N°6 : /home/yevhen//.wine is 602 Mb</p>
<p>N°7 : /home/yevhen//.cache is 324 Mb</p>
<p>N°8 : /home/yevhen//Dropbox is 324 Mb</p>
<p>N°9 : /home/yevhen//.config is 263 Mb</p>
<p>N°10 : /home/yevhen//.local is 153 Mb
</p></blockquote>
<p><a href="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png"><img src="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png" alt="script check directory space" width="250" height="200" class="aligncenter size-full wp-image-4241" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/older-files-delete/"     class="crp_title">Shell Script : Find Files Older X Days And Ask User To&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/find-rar-unrar/"     class="crp_title">Shell Script : Find All Zip / Rar Files Then Unzip / Unrar</a></li><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/check-disk-usage-is-out-of-space/"     class="crp_title">Shell Script To Check Disk Usage Is Out Of Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/login-logout-scripts/"     class="crp_title">Linux Login Logout Scripts To Send Email</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/">Shell Script To Find Directories Which Consume Highest Space</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/shell-script-2/directories-consume-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell Script To Collect Linux System Information</title>
		<link>http://www.expertslogin.com/shell-script-2/collect-linux-system-information/</link>
		<comments>http://www.expertslogin.com/shell-script-2/collect-linux-system-information/#comments</comments>
		<pubDate>Sun, 12 May 2013 20:04:47 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX SHELL SCRIPT]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4892</guid>
		<description><![CDATA[<p>Shell script that take info about linux system like logged users, uptime, load average, free memory, disk usage. Script helps to see all info about system in a second. Administration can modify the script bit ,if it requires to find system information from multiple server. Script run commands w, uname, uptime, free and df. From [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/check-disk-usage-is-out-of-space/"     class="crp_title">Shell Script To Check Disk Usage Is Out Of Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/script-check-service-up/"     class="crp_title">Shell Script : Service Status Check And start If It&#8217;s&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/backup-mysql-databases/"     class="crp_title">Shell Script : Backup MySql Databases In Compressed Format</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/shell-script-2/collect-linux-system-information/">Shell Script To Collect Linux System Information</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Shell script that take info about linux system like logged users, uptime, load average, free memory, disk usage. Script helps to see all info about system in a second. Administration can modify the script bit ,if it requires to find system information from multiple server. Script run commands w, uname, uptime, free and df. From the uptime command script take load average.</p>
<blockquote><p>#!/bin/bash</p>
<p>#clear console<br />
clear</p>
<p>#just echo welcome messages<br />
echo &#8220;This is information provided by $0 .  Program starts now.&#8221;</p>
<p>echo &#8220;Hello, $USER&#8221;</p>
<p>echo</p>
<p>#print today&#8217;s date<br />
echo &#8220;Today&#8217;s date is `date`, this is week `date +&#8221;%V&#8221;`.&#8221;</p>
<p>echo</p>
<p>#list of currently loged user via w command.<br />
echo &#8220;These users are currently connected:&#8221;</p>
<p>w | cut -d &#8221; &#8221; -f 1 &#8211; | grep -v USER | sort -u</p>
<p>echo</p>
<p>#info about system with command uname and keys -m and -s<br />
echo &#8220;This is `uname -s` running on a `uname -m` processor.&#8221;</p>
<p>echo</p>
<p>#info about uptime, using uptime command<br />
echo &#8220;This is the uptime information:&#8221;</p>
<p>uptime</p>
<p>echo</p>
<p>#info about free memory via free command<br />
echo &#8220;Free memory:&#8221;</p>
<p>free</p>
<p>echo</p>
<p>#info about disk usage<br />
echo &#8220;Disk usage:&#8221;</p>
<p>df -kh</p>
<p>echo
</p></blockquote>
<h3>Output</h3>
<p>Below is the script output.</p>
<blockquote><p>This is information provided by ./system_info.sh .  Program starts now.</p>
<p>Hello, yevhen</p>
<p>Today&#8217;s date is Sunday, March 3 2013 22:31:43 +0200, this is week 09.</p>
<p>These users are currently connected:</p>
<p>yevhen</p>
<p>This is Linux running on a i686 processor.</p>
<p>This is the uptime information:</p>
<p> 22:31:43 up  1:24,  2 users,  load average: 0.45, 0.18, 0.07</p>
<p>Free memory:</p>
<p>             total       used       free     shared    buffers     cached</p>
<p>Mem:       3374792    1589476    1785316          0      96720     725652</p>
<p>-/+ buffers/cache:     767104    2607688</p>
<p>Swap:      4192924          0    4192924</p>
<p>Disk usage:</p>
<p>Filesystem       Size  Used Avail Use% mounted<br />
/dev/sda1              42G  5,5G   35G  14% /</p>
<p>tmpfs                 1,7G     0  1,7G   0% /lib/init/rw</p>
<p>udev                  1,7G  168K  1,7G   1% /dev</p>
<p>tmpfs                 1,7G  160K  1,7G   1% /dev/shm</p>
<p>/dev/sda6             184G   26G  149G  15% /home
</p></blockquote>
<p><a href="http://www.expertslogin.com/category/shell-script-2/"><img src="http://www.expertslogin.com/wp-content/uploads/2013/03/more_shell_scripts.png" alt="shell script mysql backup" width="250" height="200" class="aligncenter size-full wp-image-4241" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/directories-consume-space/"     class="crp_title">Shell Script To Find Directories Which Consume Highest Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/check-disk-usage-is-out-of-space/"     class="crp_title">Shell Script To Check Disk Usage Is Out Of Space</a></li><li><a href="http://www.expertslogin.com/shell-script-2/script-check-service-up/"     class="crp_title">Shell Script : Service Status Check And start If It&#8217;s&hellip;</a></li><li><a href="http://www.expertslogin.com/shell-script-2/run-commands-users-home-directory/"     class="crp_title">Shell Script To Run Commands In Users Home Directory</a></li><li><a href="http://www.expertslogin.com/shell-script-2/backup-mysql-databases/"     class="crp_title">Shell Script : Backup MySql Databases In Compressed Format</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/shell-script-2/collect-linux-system-information/">Shell Script To Collect Linux System Information</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/shell-script-2/collect-linux-system-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExpertsLogIn Friday Comic Board – Pilot</title>
		<link>http://www.expertslogin.com/it-comics/pilot/</link>
		<comments>http://www.expertslogin.com/it-comics/pilot/#comments</comments>
		<pubDate>Fri, 10 May 2013 09:18:51 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[EXPERTSLOGIN FRIDAY COMIC BOARD]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4855</guid>
		<description><![CDATA[<p><div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/it-comics/chat-is-helpful/"     class="crp_title">ExpertsLogIn Friday Comic Board – Chat Is Helpful</a></li><li><a href="http://www.expertslogin.com/it-comics/love-laptop/"     class="crp_title">ExpertsLogIn Friday Comic Board – Love Laptop</a></li><li><a href="http://www.expertslogin.com/it-comics/old-parents-with-computer/"     class="crp_title">ExpertsLogIn Friday Comic Board – Old Parents With&hellip;</a></li><li><a href="http://www.expertslogin.com/it-comics/wifi-internet/"     class="crp_title">ExpertsLogIn Friday Comic Board &#8211; Wifi Internet</a></li><li><a href="http://www.expertslogin.com/it-comics/expertslogin-friday-comic-board-missing-laptop/"     class="crp_title">ExpertsLogin Friday Comic Board – Missing Laptop</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/it-comics/pilot/">ExpertsLogIn Friday Comic Board – Pilot</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.expertslogin.com/wp-content/uploads/2013/05/cockpit.jpg"><img src="http://www.expertslogin.com/wp-content/uploads/2013/05/cockpit.jpg" alt="computer comic" width="316" height="823" class="aligncenter size-full wp-image-4856" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/it-comics/chat-is-helpful/"     class="crp_title">ExpertsLogIn Friday Comic Board – Chat Is Helpful</a></li><li><a href="http://www.expertslogin.com/it-comics/love-laptop/"     class="crp_title">ExpertsLogIn Friday Comic Board – Love Laptop</a></li><li><a href="http://www.expertslogin.com/it-comics/old-parents-with-computer/"     class="crp_title">ExpertsLogIn Friday Comic Board – Old Parents With&hellip;</a></li><li><a href="http://www.expertslogin.com/it-comics/wifi-internet/"     class="crp_title">ExpertsLogIn Friday Comic Board &#8211; Wifi Internet</a></li><li><a href="http://www.expertslogin.com/it-comics/expertslogin-friday-comic-board-missing-laptop/"     class="crp_title">ExpertsLogin Friday Comic Board – Missing Laptop</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/it-comics/pilot/">ExpertsLogIn Friday Comic Board – Pilot</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/it-comics/pilot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux df command &#8211; Disk Space Usage For Filesystems</title>
		<link>http://www.expertslogin.com/linux-command/linux-df-command/</link>
		<comments>http://www.expertslogin.com/linux-command/linux-df-command/#comments</comments>
		<pubDate>Thu, 09 May 2013 21:34:58 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX BASIC COMMANDS]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4859</guid>
		<description><![CDATA[<p>The df command reports the disk space usage for the filesystems. It displays various information such as total number of blocks in the filesystem, how many of these have been used and the number of available ones. This article explains various options of this command with examples. df command options Without any switch, df displays [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/file-system/df-command-list-nfs-mount-points/"     class="crp_title">How To Use df Command To List Filesystem Mount Points</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/access-iso-files-in-ubuntu/"     class="crp_title">Access ISO Files In Ubuntu</a></li><li><a href="http://www.expertslogin.com/file-system/how-to-delete-filesystem/"     class="crp_title">Create , Format , Mount Filesystems in Linux</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/reinstall-ubuntu-bootloader-dual-boot-system/"     class="crp_title">Reinstall Ubuntu Bootloader In Dual Boot System Failure</a></li><li><a href="http://www.expertslogin.com/file-system/parted-command-to-create-partition-greater-than-2tb/"     class="crp_title">Parted Command To Create Partition Larger Than 2TB In Linux</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/linux-command/linux-df-command/">Linux df command &#8211; Disk Space Usage For Filesystems</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The df command reports the disk space usage for the filesystems. It displays various information such as total number of blocks in the filesystem, how many of these have been used and the number of available ones. This article explains various options of this command with examples.</p>
<h3>df command options</h3>
<p>Without any switch, df displays all mounted filesystems. The default output shows columns for following information: &#8216;Filesystem&#8217;, &#8217;1K-blocks&#8217;, &#8216;Used&#8217;(used blocks), &#8216;Available&#8217;(blocks), &#8216;use%&#8217;(the %age of used blocks againsta total number of blocks in a filesystem) and &#8216;Mounted on&#8217;(the mount point of a filesystem).</p>
<blockquote><p>$ df<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7       10079084   6468104   3098980  68% /<br />
udev             1521232         4   1521228   1% /dev<br />
tmpfs             613188      1164    612024   1% /run<br />
none                5120         0      5120   0% /run/lock<br />
none             1532964       304   1532660   1% /run/shm<br />
none              102400         8    102392   1% /run/user<br />
/dev/sda8        5039616   2948248   1835368  62% /home<br />
/dev/sda2      209715196 203404612   6310584  97% /media/raghu/Data</p></blockquote>
<p>If a file name is provided as the argument to df command, the filesystem on which the file resides is displayed.</p>
<blockquote><p>$ df file1.txt<br />
Filesystem     1K-blocks    Used Available Use% Mounted on<br />
/dev/sda8        5039616 2945900   1837716  62% /home</p></blockquote>
<p>The name of one or more filesystems can also be provided as argument to display the particular filesystems:</p>
<blockquote><p>$ df /dev/sda{7,8}<br />
Filesystem     1K-blocks    Used Available Use% Mounted on<br />
/dev/sda7       10079084 6468104   3098980  68% /<br />
/dev/sda8        5039616 2948336   1835280  62% /home
</p></blockquote>
<h3>Producing the grand total</h3>
<p>The &#8211;total option produces a grand total of all filesystems.</p>
<blockquote><p>$ df &#8211;total<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7       10079084   6468104   3098980  68% /<br />
udev             1521232         4   1521228   1% /dev<br />
tmpfs             613188      1164    612024   1% /run<br />
none                5120         0      5120   0% /run/lock<br />
none             1532964       304   1532660   1% /run/shm<br />
none              102400         8    102392   1% /run/user<br />
/dev/sda8        5039616   2948336   1835280  62% /home<br />
/dev/sda2      209715196 203407688   6307508  97% /media/raghu/Data<br />
total          228608800 212825608  15015192  94%</p></blockquote>
<p>(Note the last line saying total in the above output)</p>
<h3>Including dummy filesystems</h3>
<p>-a or &#8211;all option includes dummy filesystems (virtual fs like proc, sys etc).</p>
<blockquote><p>$ df -a<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7       10079084   6468104   3098980  68% /<br />
proc                   0         0         0    &#8211; /proc<br />
sysfs                  0         0         0    &#8211; /sys<br />
none                   0         0         0    &#8211; /sys/fs/fuse/connections<br />
none                   0         0         0    &#8211; /sys/kernel/debug<br />
none                   0         0         0    &#8211; /sys/kernel/security<br />
udev             1521232         4   1521228   1% /dev<br />
devpts                 0         0         0    &#8211; /dev/pts<br />
tmpfs             613188      1164    612024   1% /run<br />
none                5120         0      5120   0% /run/lock<br />
none             1532964       304   1532660   1% /run/shm<br />
none              102400         8    102392   1% /run/user<br />
/dev/sda8        5039616   2948312   1835304  62% /home<br />
/dev/sda2      209715196 203406664   6308532  97% /media/raghu/Data<br />
binfmt_misc            0         0         0    &#8211; /proc/sys/fs/binfmt_misc<br />
gvfsd-fuse             0         0         0    &#8211; /run/user/raghu/gvfs</p></blockquote>
<h3>Human Readable Format</h3>
<p>With -h options, instead of printing the number of blocks, the data is printed in MBs and GBs. The &#8217;1K-block&#8217; column is replaced with &#8216;Size&#8217; column.</p>
<blockquote><p>$ df -h /dev/sda{7,8}<br />
Filesystem      Size  Used Avail Use% Mounted on<br />
/dev/sda7       9.7G  6.2G  3.0G  68% /<br />
/dev/sda8       4.9G  2.9G  1.8G  62% /home
</p></blockquote>
<p>The -H or &#8211;si option is similar to -h, but is uses powers of 1024 and not 1000(as with -h).</p>
<blockquote><p>$ df -H /dev/sda{7,8}<br />
Filesystem      Size  Used Avail Use% Mounted on<br />
/dev/sda7        11G  6.7G  3.2G  68% /<br />
/dev/sda8       5.2G  3.1G  1.9G  62% /home</p></blockquote>
<p>The -B or &#8211;block-size=SIZE option can be used to provide custom format for sizes. SIZE may be (or may be an integer optionally followed by) one of following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.</p>
<blockquote><p>$ df -B2K /dev/sda{7,8}<br />
Filesystem     2K-blocks    Used Available Use% Mounted on<br />
/dev/sda7        5039542 3234086   1549456  68% /<br />
/dev/sda8        2519808 1474048    917760  62% /home</p></blockquote>
<blockquote><p>$ df -BM /dev/sda{7,8}<br />
Filesystem     1M-blocks  Used Available Use% Mounted on<br />
/dev/sda7          9843M 6317M     3027M  68% /<br />
/dev/sda8          4922M 2879M     1793M  62% /home</p></blockquote>
<p>The -k option is similar to &#8211;block-size=1k</p>
<blockquote><p>$ df -k /dev/sda{7,8}<br />
Filesystem     1K-blocks    Used Available Use% Mounted on<br />
/dev/sda7       10079084 6468172   3098912  68% /<br />
/dev/sda8        5039616 2948128   1835488  62% /home
</p></blockquote>
<p>The -P option uses the POSIX output format</p>
<blockquote><p>$ df -P /dev/sda{7,8}<br />
Filesystem     1024-blocks    Used Available Capacity Mounted on<br />
/dev/sda7         10079084 6468172   3098912      68% /<br />
/dev/sda8          5039616 2948128   1835488      62% /home</p></blockquote>
<h3>Printing inodes and filesystem type</h3>
<p>The inodes can be printed with -i or &#8211;inodes option.</p>
<blockquote><p>$ df -i /dev/sda{7,8}<br />
Filesystem     Inodes  IUsed  IFree IUse% Mounted on<br />
/dev/sda7      640848 288304 352544   45% /<br />
/dev/sda8      320000  50760 269240   16% /home</p></blockquote>
<p>Here, total number of inodes, used, free and %age of used inodes are shown respectively.</p>
<p>If you want to print file system types as well, -T or &#8211;print-type switch is used</p>
<blockquote><p>$ df -T<br />
Filesystem     Type     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7      ext4      10079084   6468168   3098916  68% /<br />
udev           devtmpfs   1521232         4   1521228   1% /dev<br />
tmpfs          tmpfs       613188      1164    612024   1% /run<br />
none           tmpfs         5120         0      5120   0% /run/lock<br />
none           tmpfs      1532964       304   1532660   1% /run/shm<br />
none           tmpfs       102400         8    102392   1% /run/user<br />
/dev/sda8      ext4       5039616   2948128   1835488  62% /home<br />
/dev/sda2      fuseblk  209715196 203427116   6288080  98% /media/raghu/Data</p></blockquote>
<p>Now, suppose you want to print filesystems of a particular type, say ext4 only. The -t or &#8211;type=TYPE(ext4 here) option will do this for you.</p>
<blockquote><p>$ df -t ext4<br />
Filesystem     1K-blocks    Used Available Use% Mounted on<br />
/dev/sda7       10079084 6468168   3098916  68% /<br />
/dev/sda8        5039616 2948128   1835488  62% /home</p></blockquote>
<blockquote><p>$ df -t tmpfs<br />
Filesystem     1K-blocks  Used Available Use% Mounted on<br />
tmpfs             613188  1164    612024   1% /run<br />
none                5120     0      5120   0% /run/lock<br />
none             1532964   304   1532660   1% /run/shm<br />
none              102400     8    102392   1% /run/user</p></blockquote>
<p>Similarly, for excluding a particular type of filesystem, use -x or &#8211;exclude-type=TYPE.</p>
<blockquote><p>$ df -x tmpfs<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7       10079084   6468168   3098916  68% /<br />
udev             1521232         4   1521228   1% /dev<br />
/dev/sda8        5039616   2948164   1835452  62% /home<br />
/dev/sda2      209715196 203433404   6281792  98% /media/raghu/Data</p></blockquote>
<blockquote><p>$ df -x ext4<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
udev             1521232         4   1521228   1% /dev<br />
tmpfs             613188      1164    612024   1% /run<br />
none                5120         0      5120   0% /run/lock<br />
none             1532964       304   1532660   1% /run/shm<br />
none              102400         8    102392   1% /run/user<br />
/dev/sda2      209715196 203433404   6281792  98% /media/raghu/Data
</p></blockquote>
<h3>Limit listing to local filesystems only</h3>
<p>By default, df command displays remote mounted filesystems as well. The -l option limits the listing to local filesystems only.</p>
<p>In order to check usage of this option, first we will mount a remote nfs filesystem.</p>
<blockquote><p>$ sudo mount 192.168.1.14:/nfs nfs/</p></blockquote>
<blockquote><p>$ mount | tail -2<br />
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)<br />
192.168.1.14:/nfs on /home/raghu/nfs type nfs (rw,vers=4,addr=192.168.1.14,clientaddr=192.168.1.6)</p></blockquote>
<p>Now we execute the df command:</p>
<blockquote><p>$ df<br />
Filesystem        1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7          10079084   6533664   3033420  69% /<br />
udev                1521232         4   1521228   1% /dev<br />
tmpfs                613188      1172    612016   1% /run<br />
none                   5120         0      5120   0% /run/lock<br />
none                1532964       304   1532660   1% /run/shm<br />
none                 102400        12    102388   1% /run/user<br />
/dev/sda8           5039616   2948364   1835252  62% /home<br />
/dev/sda2         209715196 203556460   6158736  98% /media/raghu/Data<br />
192.168.1.14:/nfs   9547136   3640576   5421568  41% /home/raghu/nfs
</p></blockquote>
<p>And with -l option:</p>
<blockquote><p>$ df -l<br />
Filesystem     1K-blocks      Used Available Use% Mounted on<br />
/dev/sda7       10079084   6533664   3033420  69% /<br />
udev             1521232         4   1521228   1% /dev<br />
tmpfs             613188      1172    612016   1% /run<br />
none                5120         0      5120   0% /run/lock<br />
none             1532964       304   1532660   1% /run/shm<br />
none              102400        12    102388   1% /run/user<br />
/dev/sda8        5039616   2948388   1835228  62% /home<br />
/dev/sda2      209715196 203565068   6150128  98% /media/raghu/Data
</p></blockquote>
<p><a href="http://www.expertslogin.com/category/linux-cmd/"><img src="http://www.expertslogin.com/wp-content/uploads/2013/04/1.png" alt="Linux df command" width="250" height="200" class="aligncenter size-full wp-image-4578" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/file-system/df-command-list-nfs-mount-points/"     class="crp_title">How To Use df Command To List Filesystem Mount Points</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/access-iso-files-in-ubuntu/"     class="crp_title">Access ISO Files In Ubuntu</a></li><li><a href="http://www.expertslogin.com/file-system/how-to-delete-filesystem/"     class="crp_title">Create , Format , Mount Filesystems in Linux</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/reinstall-ubuntu-bootloader-dual-boot-system/"     class="crp_title">Reinstall Ubuntu Bootloader In Dual Boot System Failure</a></li><li><a href="http://www.expertslogin.com/file-system/parted-command-to-create-partition-greater-than-2tb/"     class="crp_title">Parted Command To Create Partition Larger Than 2TB In Linux</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/linux-command/linux-df-command/">Linux df command &#8211; Disk Space Usage For Filesystems</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/linux-command/linux-df-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create or Display Hidden Files / Folders in Linux</title>
		<link>http://www.expertslogin.com/file-system/create-display-hidden-files-folders/</link>
		<comments>http://www.expertslogin.com/file-system/create-display-hidden-files-folders/#comments</comments>
		<pubDate>Tue, 07 May 2013 09:37:44 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[FILE SYSTEM]]></category>
		<category><![CDATA[LINUX HOWTO]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4815</guid>
		<description><![CDATA[<p>Here we will discuss how to create and display hidden files and folders in linux/Unix Operating Systems. Mostly our favorite &#8216;ls&#8217; command doesn&#8217;t display hidden files or folders in linux. If any file&#8217;s name starts from &#8216;.&#8217; prefix (for ex: .test) then that will call as hidden file and &#8216;ls&#8217; or &#8216;ll&#8217; command will not [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/linux-command/linux-commad-to-list-directories-directory-names-only/"     class="crp_title">Linux Commad To List Directories / Directory Names Only</a></li><li><a href="http://www.expertslogin.com/how-tos/stickbit-suid-guid/"     class="crp_title">Examples: StickBit , SUID &#038; GUID Bits Differentiate In&hellip;</a></li><li><a href="http://www.expertslogin.com/how-tos/change-attributes-of-file/"     class="crp_title">Chattr Command or Change Attributes of File</a></li><li><a href="http://www.expertslogin.com/how-tos/linux-tar-command-options-backup/"     class="crp_title">11 Examples How To Use Linux Tar Command And All Options</a></li><li><a href="http://www.expertslogin.com/linux-command/rsync-over-ssh-on-different-port-in-linux/"     class="crp_title">Rsync Over Ssh On Different Port In Linux</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/file-system/create-display-hidden-files-folders/">How To Create or Display Hidden Files / Folders in Linux</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Here we will discuss how to create and display hidden files and folders in linux/Unix Operating Systems. Mostly our favorite &#8216;ls&#8217; command doesn&#8217;t display hidden files or folders in linux. If any file&#8217;s name starts from &#8216;.&#8217; prefix (for ex: .test) then that will call as hidden file and &#8216;ls&#8217; or &#8216;ll&#8217; command will not display these hidden files and directories in output. For this we use other options (-a) or (-A) with &#8216;ls&#8217; and &#8216;ll&#8217; command. In linux hidden file&#8217;s name started from &#8216;.&#8217; prefix. We can also hide already created files and directories.</p>
<p>Let starts from creating hidden files and folders </p>
<h3>How to create hidden files</h3>
<p>Just like regular files we can create hidden files with &#8216;touch&#8217; and &#8216;vim&#8217;. &#8216;touch&#8217; will create new file and exit but vim create new file and open to modify.</p>
<h4>Create single hidden file</h4>
<blockquote><p>[root@srv test]# touch .testfile.txt</p></blockquote>
<h4>Create multiple hidden files </h4>
<blockquote><p>[root@srv test]#touch .file1 .file2 .file3</p></blockquote>
<p>or </p>
<blockquote><p>[root@srv test]# vim .test.txt</p></blockquote>
<h3>How to create hidden directory</h3>
<blockquote><p>[root@srv test]# mkdir .hiddndir </p></blockquote>
<h3>Display hidden files</h3>
<p>We will use &#8216;ls&#8217; and &#8216;ll&#8217; command to display hidden files or directories with options (-a, -A)</p>
<blockquote><p>[root@srv test]# ls -a</p>
<p>.  ..  .DIR  .hiddndir .test.txt</p>
</blockquote>
<p>or</p>
<blockquote><p>[root@srv test]# ls -al</p>
<p>total 20<br />
drwxr-xr-x. 4 root root 4096 May  3 18:59    .<br />
drwxr-xr-x. 3 root root 4096 May  3 18:52     ..<br />
drwxr-xr-x. 2 root root 4096 May  3 18:59    .DIR<br />
drwxr-xr-x. 2 root root 4096 May  3 18:47   .hiddndir<br />
-rw-r&#8211;r&#8211;. 1 root root   11 May  3 18:35      .test.txt
</p></blockquote>
<blockquote><p>
[root@srv test]# ll -a</p>
<p>total 20<br />
drwxr-xr-x. 4 root root 4096 May  3 18:59    .<br />
drwxr-xr-x. 3 root root 4096 May  3 18:52     ..<br />
drwxr-xr-x. 2 root root 4096 May  3 18:59    .DIR<br />
drwxr-xr-x. 2 root root 4096 May  3 18:47   .hiddndir<br />
-rw-r&#8211;r&#8211;. 1 root root   11 May  3 18:35      .test.txt
</p></blockquote>
<p>&#8216;-a&#8217; displays hidden files and directories with current directory (.) and parent directory (..), and  &#8216;-A&#8217; doesn&#8217;t display current directory (.) and parent directory (..) as below:</p>
<blockquote><p>[root@srv test]# ls -A</p>
<p>.DIR      .hiddndir      .test.txt
</p></blockquote>
<p>or </p>
<blockquote><p>[root@srv test]# ll -A</p>
<p>total 12<br />
drwxr-xr-x. 2 root root 4096 May  3 18:59   .DIR<br />
drwxr-xr-x. 2 root root 4096 May  3 18:47   .hiddndir<br />
-rw-r&#8211;r&#8211;. 1 root root   11 May  3 18:35   .test.txt
</p></blockquote>
<h3>Hide already created file and directory</h3>
<blockquote><p>[root@srv test]# ll</p>
<p>total 4<br />
-rw-r&#8211;r&#8211;. 1 root root    0 May  3 19:11    info.txt<br />
drwxr-xr-x. 2 root root 4096 May  3 19:11    nike
</p></blockquote>
<p>let suppose we have already created file info.txt and directory nike and we will hide this file and folder as below </p>
<blockquote><p>[root@srv test]# mv info.txt .info.txt</p>
<p>[root@srv test]# mv nike .nike</p></blockquote>
<blockquote><p>[root@srv test]# ll -A</p>
<p>total 12<br />
-rw-r&#8211;r&#8211;. 1 root root    0 May  3 19:11 .info.txt<br />
drwxr-xr-x. 2 root root 4096 May  3 19:11 .nike</p>
</blockquote>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/linux-command/linux-commad-to-list-directories-directory-names-only/"     class="crp_title">Linux Commad To List Directories / Directory Names Only</a></li><li><a href="http://www.expertslogin.com/how-tos/stickbit-suid-guid/"     class="crp_title">Examples: StickBit , SUID &#038; GUID Bits Differentiate In&hellip;</a></li><li><a href="http://www.expertslogin.com/how-tos/change-attributes-of-file/"     class="crp_title">Chattr Command or Change Attributes of File</a></li><li><a href="http://www.expertslogin.com/how-tos/linux-tar-command-options-backup/"     class="crp_title">11 Examples How To Use Linux Tar Command And All Options</a></li><li><a href="http://www.expertslogin.com/linux-command/rsync-over-ssh-on-different-port-in-linux/"     class="crp_title">Rsync Over Ssh On Different Port In Linux</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/file-system/create-display-hidden-files-folders/">How To Create or Display Hidden Files / Folders in Linux</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/file-system/create-display-hidden-files-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chattr Command or Change Attributes of File</title>
		<link>http://www.expertslogin.com/how-tos/change-attributes-of-file/</link>
		<comments>http://www.expertslogin.com/how-tos/change-attributes-of-file/#comments</comments>
		<pubDate>Sun, 05 May 2013 07:58:30 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[FILE SYSTEM]]></category>
		<category><![CDATA[HOWTOS]]></category>
		<category><![CDATA[LINUX BASIC COMMANDS]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4783</guid>
		<description><![CDATA[<p>Attributes of file or extend attributes of file are simple and easy to use.  Chattr command uses to change file attributes on a Linux in ext2 or ext3 file system.  After changing attributes no one can modify or delete a file even they have full access. Chattr keep safe from accidentally deleting files or directories. [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/how-tos/howto-show-file-attributes-in-linux/"     class="crp_title">HowTo : Show File Attributes In Linux</a></li><li><a href="http://www.expertslogin.com/file-system/create-display-hidden-files-folders/"     class="crp_title">How To Create or Display Hidden Files / Folders in Linux</a></li><li><a href="http://www.expertslogin.com/linux-command/linux-usermod-command-to-modify-user-details/"     class="crp_title">Linux Usermod Command To Modify User Details</a></li><li><a href="http://www.expertslogin.com/linux-command/linux-inode/"     class="crp_title">Detailed Understanding Of Linux Inodes With Example</a></li><li><a href="http://www.expertslogin.com/linux-how-to/monitoring-hard-disk-working-smartctl-tool/"     class="crp_title">Linux Smartctl Tool : Check Hard Disk Error And Health Check</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/how-tos/change-attributes-of-file/">Chattr Command or Change Attributes of File</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Attributes of file or extend attributes of file are simple and easy to use.  Chattr command uses to change file attributes on a Linux in ext2 or ext3 file system.  After changing attributes no one can modify or delete a file even they have full access. Chattr keep safe from accidentally deleting files or directories.</p>
<h3> Check File Attributes</h3>
<p>We can check what attributes are set of a file as below:</p>
<blockquote><p># lsattr </p></blockquote>
<p>example:</p>
<blockquote><p># lsattr test.txt<br />
- &#8211; - &#8211; - &#8211; - &#8211; - test.txt</p></blockquote>
<h3>Change Attributes of File</h3>
<p>chattr command which changes the file attributes on a Linux, Let suppose if we will change a file attribute to &#8216;+i&#8217; attribute. A file with the i attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file, even root user can&#8217;t modify this.</p>
<blockquote><p># chattr +i test.txt</p></blockquote>
<blockquote><p># lsattr test.txt<br />
- &#8211; - &#8211; i &#8211; - &#8211; - test.txt</p></blockquote>
<p>If you want to changes in file you need to revert back attributes as below:</p>
<blockquote><p># chattr -i test.txt</p></blockquote>
<p>if you want to allow everybody to just append data to a file and not change already entered data, you can set the append bit as follows:</p>
<blockquote><p># chattr +a  </p></blockquote>
<p>example</p>
<blockquote><p># lsattr +a test.txt<br />
- &#8211; - &#8211; a &#8211; - &#8211; - test.txt</p></blockquote>
<p>revert back as:</p>
<blockquote><p># chattr -a test.txt</p></blockquote>
<h4>There are more options that can use with chattr command</h4>
<blockquote><p>Options</p>
<p>-R   Modify directories and their contents recursively.</p>
<p>-V   Print modes of attributes after changing them.</p>
<p>-v version   Set the file&#8217;s version.</p></blockquote>
<blockquote><p>Opcodes</p>
<p>+   Add attribute.</p>
<p>-   Remove attribute.</p>
<p>=   Assign attributes (removing unspecified attributes).</p></blockquote>
<p>The operator `+&#8217; causes the selected attributes to be added to the existing attributes of the files; `-&#8217; causes them to be removed; and `=&#8217; causes them to be the only attributes that the files have.</p>
<blockquote><p>
Attributes</p>
<p>A   Don&#8217;t update access time on modify.</p>
<p>a   Append only for writing. Can be set or cleared only by a privileged user.</p>
<p>c   Compressed.</p>
<p>d   No dump.</p>
<p>i   Immutable. Can be set or cleared only by a privileged user.</p>
<p>j   Journalled file. This is useful only in cases where you are using an ext3 filesystem mounted with the data=&#8221;ordered&#8221; or data=&#8221;writeback&#8221; attributes. The data=&#8221;journalled&#8221; option for the filesystem causes this operation to be performed for all files in the system and makes this option irrelevant.</p>
<p>S   Synchronous updates.</p>
<p>s   Secure deletion. The contents are zeroed on deletion, and the file cannot be undeleted or recovered in any way.</p>
<p>u   Undeletable. This causes a file to be saved even after it has been deleted, so that a user can undelete it later.</p></blockquote>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/how-tos/howto-show-file-attributes-in-linux/"     class="crp_title">HowTo : Show File Attributes In Linux</a></li><li><a href="http://www.expertslogin.com/file-system/create-display-hidden-files-folders/"     class="crp_title">How To Create or Display Hidden Files / Folders in Linux</a></li><li><a href="http://www.expertslogin.com/linux-command/linux-usermod-command-to-modify-user-details/"     class="crp_title">Linux Usermod Command To Modify User Details</a></li><li><a href="http://www.expertslogin.com/linux-command/linux-inode/"     class="crp_title">Detailed Understanding Of Linux Inodes With Example</a></li><li><a href="http://www.expertslogin.com/linux-how-to/monitoring-hard-disk-working-smartctl-tool/"     class="crp_title">Linux Smartctl Tool : Check Hard Disk Error And Health Check</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/how-tos/change-attributes-of-file/">Chattr Command or Change Attributes of File</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/how-tos/change-attributes-of-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExpertsLogIn Friday Comic Board – Take Off From Work</title>
		<link>http://www.expertslogin.com/it-comics/take-off-from-work/</link>
		<comments>http://www.expertslogin.com/it-comics/take-off-from-work/#comments</comments>
		<pubDate>Fri, 03 May 2013 06:28:12 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[EXPERTSLOGIN FRIDAY COMIC BOARD]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4810</guid>
		<description><![CDATA[<p><div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/it-comics/love-laptop/"     class="crp_title">ExpertsLogIn Friday Comic Board – Love Laptop</a></li><li><a href="http://www.expertslogin.com/it-comics/it-helps-priests/"     class="crp_title">ExpertsLogIn Friday Comic Board &#8211; IT Helps Priests</a></li><li><a href="http://www.expertslogin.com/it-comics/expertslogin-friday-comic-board-it-job/"     class="crp_title">ExpertsLogIn Friday Comic Board – IT Job</a></li><li><a href="http://www.expertslogin.com/it-comics/friday-comic-it-doctor/"     class="crp_title">ExpertsLogIn Friday Comic Board – IT Doctor</a></li><li><a href="http://www.expertslogin.com/it-comics/chat-is-helpful/"     class="crp_title">ExpertsLogIn Friday Comic Board – Chat Is Helpful</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/it-comics/take-off-from-work/">ExpertsLogIn Friday Comic Board – Take Off From Work</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.expertslogin.com/wp-content/uploads/2013/05/FINALFUNERAL.jpg"><img src="http://www.expertslogin.com/wp-content/uploads/2013/05/FINALFUNERAL.jpg" alt="Comics humor" width="312" height="537" class="aligncenter size-full wp-image-4811" /></a></p>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/it-comics/love-laptop/"     class="crp_title">ExpertsLogIn Friday Comic Board – Love Laptop</a></li><li><a href="http://www.expertslogin.com/it-comics/it-helps-priests/"     class="crp_title">ExpertsLogIn Friday Comic Board &#8211; IT Helps Priests</a></li><li><a href="http://www.expertslogin.com/it-comics/expertslogin-friday-comic-board-it-job/"     class="crp_title">ExpertsLogIn Friday Comic Board – IT Job</a></li><li><a href="http://www.expertslogin.com/it-comics/friday-comic-it-doctor/"     class="crp_title">ExpertsLogIn Friday Comic Board – IT Doctor</a></li><li><a href="http://www.expertslogin.com/it-comics/chat-is-helpful/"     class="crp_title">ExpertsLogIn Friday Comic Board – Chat Is Helpful</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/it-comics/take-off-from-work/">ExpertsLogIn Friday Comic Board – Take Off From Work</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/it-comics/take-off-from-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Change Time Zone In MYSQL</title>
		<link>http://www.expertslogin.com/linux-how-to/change-time-zone-mysql/</link>
		<comments>http://www.expertslogin.com/linux-how-to/change-time-zone-mysql/#comments</comments>
		<pubDate>Thu, 02 May 2013 11:17:35 +0000</pubDate>
		<dc:creator>NixSavy</dc:creator>
				<category><![CDATA[LINUX HOWTO]]></category>

		<guid isPermaLink="false">http://www.expertslogin.com/?p=4772</guid>
		<description><![CDATA[<p>This article is all about changing time zone in MySql. If mysql time zone is not correct, if different from your time zone, you can change it by following steps. Check current mysql time zone You should check the current time as below Login to mysql with root user, run below command #mysql or #mysql [...]<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/backup-mysql-databases/"     class="crp_title">Shell Script : Backup MySql Databases In Compressed Format</a></li><li><a href="http://www.expertslogin.com/shell-script-2/create-mysql-user/"     class="crp_title">Shell Script : Interactive Way To Create Mysql User And&hellip;</a></li><li><a href="http://www.expertslogin.com/how-tos/howto-change-set-timezone-in-linux-with-example/"     class="crp_title">HowTo : Change / Set Timezone In Linux With Example</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/easy-steps-installing-wordpress-on-ubuntu-using-apt-get/"     class="crp_title">Easy Steps Installing WordPress On Ubuntu Using Apt-Get</a></li><li><a href="http://www.expertslogin.com/how-tos/lsof-command-list-process-id-information/"     class="crp_title">LSOF In Linux : Find Process Listening to Port / Files&hellip;</a></li></ul></div></p><p>The post <a href="http://www.expertslogin.com/linux-how-to/change-time-zone-mysql/">How To Change Time Zone In MYSQL</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.expertslogin.com/category/linux-cmd/"><img src="http://www.expertslogin.com/wp-content/uploads/2013/04/1.png" alt="Linux commands" width="250" height="200" class="aligncenter size-full wp-image-4578" /></a></p>
<p>This article is all about changing time zone in MySql. If mysql time zone is not correct, if different from your time zone, you can change it by following steps.</p>
<h3>Check current mysql time zone</h3>
<p>You should check the current time as below</p>
<h4>Login to mysql with root user, run below command</h4>
<blockquote><p>#mysql</p></blockquote>
<p>or</p>
<blockquote><p>#mysql -u root -p</p></blockquote>
<blockquote><p>Enter root password:</p></blockquote>
<blockquote><p>mysql&gt; SELECT NOW();</p></blockquote>
<blockquote><p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| NOW() |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| 2013-05-01 06:43:52 |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
1 row in set (0.00 sec)</p></blockquote>
<h3>Change Timezone</h3>
<h4>Stop mysql service</h4>
<blockquote><p>service mysqld stop</p></blockquote>
<blockquote><p>shutting down mysqld &#8230;&#8230;&#8230;&#8230;&#8230;.. OK</p></blockquote>
<p>Check time_zone tables in mysql db. If it is empty then fill them using below command.</p>
<blockquote><p>mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql</p></blockquote>
<p>if you have set root password then:</p>
<blockquote><p>mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p</p></blockquote>
<h4>Execute below command as root user to change timezone</h4>
<blockquote><p>mysql&gt; SET GLOBAL time_zone = timezone;</p></blockquote>
<p>Example:</p>
<blockquote><p>mysql&gt; SET GLOBAL time_zone = “Asia/Calcutta”;</p></blockquote>
<p>The above command will set the timezone to Asia/Calcutta globally. You can change the time zone as per your timezone.</p>
<h4>Start mysql service</h4>
<blockquote><p>service mysqld start</p></blockquote>
<blockquote><p>starting mysqld &#8230;&#8230;&#8230;&#8230;. OK</p></blockquote>
<div class="crp_related"><h3>You May Like Below Topics</h3><ul><li><a href="http://www.expertslogin.com/shell-script-2/backup-mysql-databases/"     class="crp_title">Shell Script : Backup MySql Databases In Compressed Format</a></li><li><a href="http://www.expertslogin.com/shell-script-2/create-mysql-user/"     class="crp_title">Shell Script : Interactive Way To Create Mysql User And&hellip;</a></li><li><a href="http://www.expertslogin.com/how-tos/howto-change-set-timezone-in-linux-with-example/"     class="crp_title">HowTo : Change / Set Timezone In Linux With Example</a></li><li><a href="http://www.expertslogin.com/ubuntu-how-to/easy-steps-installing-wordpress-on-ubuntu-using-apt-get/"     class="crp_title">Easy Steps Installing WordPress On Ubuntu Using Apt-Get</a></li><li><a href="http://www.expertslogin.com/how-tos/lsof-command-list-process-id-information/"     class="crp_title">LSOF In Linux : Find Process Listening to Port / Files&hellip;</a></li></ul></div><p>The post <a href="http://www.expertslogin.com/linux-how-to/change-time-zone-mysql/">How To Change Time Zone In MYSQL</a> appeared first on <a href="http://www.expertslogin.com">ExpertsLogIn</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.expertslogin.com/linux-how-to/change-time-zone-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->