<?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>FAQforge &#187; Shell</title> <atom:link href="http://www.faqforge.com/tag/shell/feed/" rel="self" type="application/rss+xml" /><link>http://www.faqforge.com</link> <description>Just another WordPress weblog</description> <lastBuildDate>Fri, 03 Feb 2012 13:47:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Use of Shell, Registry, Keyboard and Voice in VBScript (Windows)</title><link>http://www.faqforge.com/windows/use-of-shell-registry-keyboard-and-voice-in-vbscript-windows/</link> <comments>http://www.faqforge.com/windows/use-of-shell-registry-keyboard-and-voice-in-vbscript-windows/#comments</comments> <pubDate>Fri, 28 Oct 2011 07:32:36 +0000</pubDate> <dc:creator>CSch</dc:creator> <category><![CDATA[Vista]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[Windows 7]]></category> <category><![CDATA[XP]]></category> <category><![CDATA[autostart]]></category> <category><![CDATA[basic]]></category> <category><![CDATA[computer]]></category> <category><![CDATA[key]]></category> <category><![CDATA[registry]]></category> <category><![CDATA[script]]></category> <category><![CDATA[sendkey]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[speaking]]></category> <category><![CDATA[visual]]></category> <category><![CDATA[voice]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=1051</guid> <description><![CDATA[Look here to learn how to create Visual Basic Scripts. Using Visual Basic Script you can also access elementary Windows services, some them being really useful to irritate your friends. If at any point of the script there is an error stating that the double-quotes used in it are invalid characters, just delete the copied [...]]]></description> <content:encoded><![CDATA[<p>Look <a
href="http://www.faqforge.com/windows/messages-loops-and-pauses-with-visual-basic-script/">here</a> to learn how to create Visual Basic Scripts.</p><p>Using Visual Basic Script you can also access elementary Windows services, some them being really useful to irritate your friends. If at any point of the script there is an error stating that the double-quotes used in it are invalid characters, just delete the copied ones and type them again manually.<br
/> With the use of a <strong>shell</strong>, you can make VBScripts run programs and other executables. To do so you have to specify following line in the beginning of the script:</p><p
class="command">Set objShell = wscript.CreateObject(&#8220;wScript.Shell&#8221;)</p><p>Afterwards you can run commands with</p><p
class="command">objShell.run program</p><p>where you replace <em>program</em> with the program you want to run.<br
/> To add an executable to the <strong>autostart</strong> list via <strong>registry</strong>, you use the following script:</p><p
class="command">objShell.Regwrite &#8220;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\some_name.exe&#8221;,&#8221;C:\the\files\path.vbs</p><p>Replace the name with any name, it really can be any name, and the path of the file with the correct path. The script will then be executed on every start-up (be careful if you use this in combination with more dangerous scripts).<br
/> To make the script itself type as if it was the <strong>keyboard</strong>, use this script (a shell must be set for this as in the first script shown here):</p><p
class="command">objShell.sendkeys&#8221;key_goes_here&#8221;</p><p>Replace <em>key_goes_here</em> with the keys the script is supposed to hit. Some of them are embraced by curly brackets, as for example &#8220;{CAPSLOCK}&#8221;, &#8220;{NUMLOCK}&#8221;, &#8220;{SCROLLOCK}&#8221; and &#8220;{bs}&#8221; (backspace). Most however go without, as do all letter keys and enter (&#8220;~&#8221;). Combining all the locks with a loop usually gives a great script!<br
/> To make Windows&#8217; integrated <strong>voice</strong> say some words defined by you, use the following script:</p><p
class="command">Set objVoice = CreateObject(&#8220;SAPI.SpVoice&#8221;)<br
/> objVoice.Speak &#8220;blabla&#8221;</p><p>Replace <em>blabla</em> with some serious things your computer has to say to you.</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/windows/use-of-shell-registry-keyboard-and-voice-in-vbscript-windows/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Get the name of the newest file in a directory on the linux shell</title><link>http://www.faqforge.com/linux/get-the-name-of-the-newest-file-in-a-directory-on-the-linux-shell/</link> <comments>http://www.faqforge.com/linux/get-the-name-of-the-newest-file-in-a-directory-on-the-linux-shell/#comments</comments> <pubDate>Fri, 14 Oct 2011 12:59:54 +0000</pubDate> <dc:creator>Till</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[CentOS]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Distributions]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[shellscript]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=887</guid> <description><![CDATA[If you have a directory with many files (a few thousand in my case) and need to know which one is the newest, then the following command might be useful. It returns the name and details of the newest file in a directory where it is executed: ls -tl &#124; sed -n 2p]]></description> <content:encoded><![CDATA[<p>If you have a directory with many files (a few thousand in my case) and need to know which one is the newest, then the following command might be useful. It returns the name and details of the newest file in a directory where it is executed:</p><p
class="command">ls -tl | sed -n 2p</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/get-the-name-of-the-newest-file-in-a-directory-on-the-linux-shell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Disable quota for a Linux user or group on the shell</title><link>http://www.faqforge.com/linux/disable-quota-for-a-linux-user-or-group-on-the-shell/</link> <comments>http://www.faqforge.com/linux/disable-quota-for-a-linux-user-or-group-on-the-shell/#comments</comments> <pubDate>Thu, 05 May 2011 14:30:51 +0000</pubDate> <dc:creator>Till</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[CentOS]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Distributions]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Quota]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=576</guid> <description><![CDATA[Linux user quotas can be edited with the commands edquota or setquota on the shell. While edquota opens the quota settings in a editor like vim, setquota allows you to specify the quota settings on the commandline. Example for disabling the quota for the user &#8220;testuser&#8221;: setquota -u testuser 0 0 0 0 -a Example [...]]]></description> <content:encoded><![CDATA[<p>Linux user quotas can be edited with the commands edquota or setquota on the shell. While edquota opens the quota settings in a editor like vim, setquota allows you to specify the quota settings on the commandline.</p><p>Example for disabling the quota for the user &#8220;testuser&#8221;:</p><p
class="command">setquota -u testuser 0 0 0 0 -a</p><p>Example for disabling quota for the group &#8220;testgroup&#8221;:</p><p
class="command">setquota -g testgroup 0 0 0 0 -a</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/disable-quota-for-a-linux-user-or-group-on-the-shell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Rerun the last command with sudo on the Linux shell</title><link>http://www.faqforge.com/linux/rerun-the-last-command-with-sudo-on-the-linux-shell/</link> <comments>http://www.faqforge.com/linux/rerun-the-last-command-with-sudo-on-the-linux-shell/#comments</comments> <pubDate>Fri, 19 Feb 2010 12:30:39 +0000</pubDate> <dc:creator>Till</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=397</guid> <description><![CDATA[Have you ever executed a command on the shell and noticed the that you had to run it with sudo? Instead of typing the command again with &#8220;sudo&#8221; in front of it, just run: sudo !! which will execute the command that was run before with sudo. Thanks to Planetfox for this tipp.]]></description> <content:encoded><![CDATA[<p>Have you ever executed a command on the shell and noticed the that you had to run it with sudo? Instead of typing the command again with &#8220;sudo&#8221; in front of it, just run:</p><p
class="command">sudo !!</p><p>which will execute the command that was run before with sudo. Thanks to <a
href="http://www.planetfox.de/" target="_blank">Planetfox</a> for this tipp.</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/rerun-the-last-command-with-sudo-on-the-linux-shell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to prevent a Linux system user from loggin into the system</title><link>http://www.faqforge.com/linux/how-to-prevent-a-linux-system-user-from-loggin-into-the-system/</link> <comments>http://www.faqforge.com/linux/how-to-prevent-a-linux-system-user-from-loggin-into-the-system/#comments</comments> <pubDate>Fri, 23 Oct 2009 12:55:08 +0000</pubDate> <dc:creator>Till</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Distributions]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=257</guid> <description><![CDATA[If a linux system user is able to login on the shell or with SSH depends on its shell setting in /etc/passwd. If you want to prevent that a certain user is able to login, then set the shell either to /bin/false or /sbin/nologin. Example for Debian and Ubuntu Linux for the user with the [...]]]></description> <content:encoded><![CDATA[<p>If a linux system user is able to login on the shell or with SSH depends on its shell setting in <span
class="system">/etc/passwd</span>. If you want to prevent that a certain user is able to login, then set the shell either to <span
class="system">/bin/false</span> or <span
class="system">/sbin/nologin</span>.</p><p>Example for Debian and Ubuntu Linux for the user with the username &#8220;otheruser&#8221;:</p><p
class="command">usermod -s /bin/false otheruser</p><p>For Redhat, Fedora or CentOS use /sbin/nologin:</p><p
class="command">usermod -s /sbin/nologin otheruser</p><p><strong>Warning:</strong> Do not set the shell for the root user to /bin/false or /sbin/nologin!</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/how-to-prevent-a-linux-system-user-from-loggin-into-the-system/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to prevent that a user deletes a file owned by root in its home directory</title><link>http://www.faqforge.com/linux/how-to-prevent-that-a-user-deletes-a-file-owned-by-root-in-its-home-directory/</link> <comments>http://www.faqforge.com/linux/how-to-prevent-that-a-user-deletes-a-file-owned-by-root-in-its-home-directory/#comments</comments> <pubDate>Fri, 23 Oct 2009 12:13:10 +0000</pubDate> <dc:creator>Till</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=254</guid> <description><![CDATA[If the root user stores a file in the home directory of another user or any other directory that is owned by another user, this other user is able to delete the file even if the file is owned by root and has 700 permissions. Example: root@workstation:/home/otheruser# ls -la total 8 drwxr-xr-x 2 otheruser otheruser [...]]]></description> <content:encoded><![CDATA[<p>If the root user stores a file in the home directory of another user or any other directory that is owned by another user, this other user is able to delete the file even if the file is owned by root and has 700 permissions.</p><p><strong>Example:</strong></p><p
class="command">root@workstation:/home/otheruser# ls -la<br
/> total 8<br
/> drwxr-xr-x 2 otheruser otheruser 4096 Oct 23 11:52 .<br
/> drwxr-xr-x 3 root      root      4096 Oct 23 11:51 ..<br
/> -rwx&#8212;&#8212; 1 root      root         0 Oct 23 11:52 root_users_file</p><p>If I su now to &#8220;otheruser&#8221;, I&#8217;am able to delete the file as &#8220;otheruser&#8221; is the owner of the directory where &#8220;root_users_file&#8221; is stored:</p><p
class="command">root@workstation:/home/otheruser# su otheruser<br
/> sh-3.2$ rm root_users_file<br
/> rm: remove write-protected regular empty file `root_users_file&#8217;? y<br
/> sh-3.2$</p><p>Now to protect the file from beeing deleted, use the command <span
class="system">chattr +i</span>:</p><p
class="command">chattr +i root_users_file</p><p>and then try again to delete the file as &#8220;otheruser&#8221;, the action will be denied:</p><p
class="command">root@workstation:/home/otheruser# su otheruser<br
/> sh-3.2$ rm root_users_file<br
/> rm: remove write-protected regular empty file `root_users_file&#8217;? y<br
/> rm: cannot remove `root_users_file&#8217;: Operation not permitted<br
/> sh-3.2$</p><p>Now even root is not able to delete or edit the file anymore. With the command <span
class="system">chattr -i</span> the protection can be removed:</p><p
class="command">chattr -i root_users_file</p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/how-to-prevent-that-a-user-deletes-a-file-owned-by-root-in-its-home-directory/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to convert filenames or text to lowercase on the shell</title><link>http://www.faqforge.com/linux/how-to-convert-filenames-or-text-to-lowercase-on-the-shell/</link> <comments>http://www.faqforge.com/linux/how-to-convert-filenames-or-text-to-lowercase-on-the-shell/#comments</comments> <pubDate>Wed, 02 Sep 2009 09:57:56 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Basics]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Linux & Unix]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://www.faqforge.com/?p=185</guid> <description><![CDATA[There is no simple tolower command on the bash, but with a little shell script you can convert uppercase characters to lowercase. The script uses the tr command internally for converting the chars. Create a shell script with the name tolower: vi /usr/local/bin/tolower and enter the following content: #!/bin/sh echo $1 &#124; tr &#8216;[:upper:]&#8216; &#8216;[:lower:]&#8216; [...]]]></description> <content:encoded><![CDATA[<p>There is no simple tolower command on the bash, but with a little shell script you can convert uppercase characters to lowercase. The script uses the tr command internally for converting the chars.</p><p>Create a shell script with the name tolower:</p><p
class="command">vi /usr/local/bin/tolower</p><p>and enter the following content:</p><p
class="system">#!/bin/sh<br
/> echo $1 | tr &#8216;[:upper:]&#8216; &#8216;[:lower:]&#8216;</p><p>Then make the script executable:</p><p
class="command">chmod +x /usr/local/bin/tolower</p><p>An test it by executing this command on the shell:</p><p
class="command">tolower &#8220;Thats a Test&#8221;</p><p>will convert the string to lowercase and show the result on the shell:</p><p><span
class="system">thats a test</span></p> ]]></content:encoded> <wfw:commentRss>http://www.faqforge.com/linux/how-to-convert-filenames-or-text-to-lowercase-on-the-shell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/37 queries in 0.041 seconds using disk: basic
Object Caching 1113/1200 objects using disk: basic

Served from: www.faqforge.com @ 2012-02-05 00:09:38 -->
