Do you know Bash & csh shell likes carrots ?

When we try to execute a command at the shell, we make mistakes like missing out a character or misspell it. Do you know you can correct them without having to type the command again or taking the history and changing them ? See the following example to understand the use of carrots!

# find . -naem “*.php” -exec chmod 644 {} \;
find: invalid predicate `-naem’

This is when carrots comes to help. Issue this command in the shell and you will get the results.

# ^em^me^
find . -name “*.php” -exec chmod 644 {} \;

If you just execute the command without a proper history to replace, it will display,

bash: :s^em^me^: substitution failed

[related_posts]

Related posts:

  1. Virtfs dir for shell enabled user is not removed on termination of account or removal of shell
  2. Chapter 11 Basic Shell Scripting in Linux!
  3. Why are you getting 500 internal server error on your php pages
  4. Matching and deleting patterns across multiple lines in vi
  5. Chapter 7 Basic Commands in Linux.

Comment Form

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later