Magic space on the current command line

2010-06-25 1 min read Bash Fedora Linux

# For how to set up magic space for Bash see:
# – http://www.ukuug.org/events/linux2003/papers/bash_tips/#slide15
# – http://codesnippets.joyent.com/posts/show/1690

man bash 2>/dev/null | less -p ’magic-space’

man bash 2>/dev/null | less -p ’Event Designators’

man bash 2>/dev/null | less -p &#8217;\!#&#8217; # &#8221;The entire <a class="zem_slink" title="Command-line interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Command-line_interface">command line typed so far.&#8221;

<a href="http://snippets.dzone.com/posts/show/10265">Read more :<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.makeuseof.com/tag/trigger-wake-lan-mac-address/">How To Trigger Wake On LAN Using The MAC Address (makeuseof.com) <li class="zemanta-article-ul-li"><a href="http://smarterware.org/4271/projectview-lists-your-todo-txt-by-project">Projectview Lists Your Todo.txt by Project (smarterware.org) <li class="zemanta-article-ul-li"><a href="http://helpdeskgeek.com/linux-tips/shell-script-backup-directory-linux/">Back Up a Directory in Linux using a Shell Script (helpdeskgeek.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/038d79c3-59e6-41ad-a8ad-31d1af669509/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e39.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading

wmctrl – window control manager

2010-06-16 0 min read Fedora Linux
\"Blue
Image via Wikipedia

What is <a class="zem_slink freebase/en/wmctrl" title="Wmctrl" rel="wikipedia" href="http://en.wikipedia.org/wiki/Wmctrl">wmctrl?

wmctrl  is  a  command that can be used to interact with an X Window manager that is compatible with the EWMH/NetWM specification.  wmctrl can query the <a class="zem_slink freebase/en/window_manager" title="Window manager" rel="wikipedia" href="http://en.wikipedia.org/wiki/Window_manager">window manager for information, and it can request that certain window management actions be taken.

Continue reading

Verify all the paths in the PATH directory

2010-06-08 1 min read Bash Learning Linux

Here is the command to test that all the directories in your path actually exist.

(<a class="zem_slink freebase/en/internal_field_separator" title="Internal field separator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internal_field_separator">IFS=:;for p in $PATH; do test -d $p || echo $p; done)

And the explanation :

Set the IFS to &#8221;:&#8221;

now we loop through the PATH variable

and test all the directories with &#8221;test -d&#8221;

Here is another version without IFS:

for i in ${PATH//:/ };do test  -d $i || echo $i;done

Continue reading

command not found – packagekit plugin

2010-05-27 0 min read Fedora Linux
\"Example
Image via Wikipedia

If you run into problems where you run some command and the command is not found and you have to install it and run the program again then why not use the command not found <a class="zem_slink freebase/en/plugin" title="Plug-in (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Plug-in_%28computing%29">plugin for Packagekit. Here is the description:

Continue reading

Find out why a program can't seem to access to a file

2010-05-05 2 min read Fedora Linux

$ strace php tias.php -e open,access 2>&1 | <a class="zem_slink freebase/en/grep" href="http://en.wikipedia.org/wiki/Grep" title="Grep" rel="wikipedia">grep foo.txt Sometimes a program refuses to read a file and you&#8217;re not sure why. You may have display_errors turned off for <a class="zem_slink freebase/en/php" href="http://www.php.net/" title="PHP" rel="homepage">PHP or something. In this example, fopen(&#8217;/var/www/test/foo.txt&#8217;) was called but doesn&#8217;t have read access to foo.txt.

Strace can tell you what went wrong. E.g., if php doesn&#8217;t have read access to the file, strace will say &#8221;EACCESS (Permission denied)&#8221;. Or, if the <a class="zem_slink freebase/guid/9202a8c04000641f8000000000220ffa" href="http://en.wikipedia.org/wiki/Path_%28computing%29" title="Path (computing)" rel="wikipedia">file path you gave doesn&#8217;t exist, strace will say &#8221;ENOENT (No such file or directory)&#8221;, etc.

Continue reading

vim understanding the various modes and using the yanking more efficiently.

2010-04-06 0 min read Linux Vim Tips
\"MacVim
Image via Wikipedia

We will look at the vim modes today. Sometime back , I was looking at copying a function body. So I was basically looking to copy the lines till matching &#8221;}&#8221;. I found a plugin called <a href="http://www.vim.org/scripts/script.php?script_id=1234" target="_blank">yankring which would allow me to yank the text in various combinations. So I can copy a function by going to the begining of the function and then &#8221;y}&#8221;. That is very simple to understand right? Wrong!!!

Continue reading

whohas

2010-01-16 0 min read Linux
\"??????\"
Image by tutchiio via Flickr
??
Description: whohas is a command line tool that allows querying several package lists at once – currently supported are Arch, Debian, Gentoo and Slackware. whohas is written in Perl and was designed to help  package maintainers find ebuilds, pkgbuilds and similar package definitions from other distributions to learn from.

Example output for

Continue reading
Older posts Newer posts