?
Solved

find command

Posted on 2002-03-13
3
Medium Priority
?
167 Views
Last Modified: 2013-12-15
I want to configure my linux account so that the command  'fnd argument' is equivalent to:           'find / -name argument 2> /dev/null'    I know I should put it in .bashrc as an alias or a user-defined function, but I'm having a hard time making it work.  Does anybody know the proper syntax for doing this?  
0
Comment
Question by:alphaomega232
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 800 total points
ID: 6860621
Try:

fnd () { find / -name $1 2>/dev/null; }

To have the command available each time you log in you'll want to include that function in your .bashrc file.
0
 
LVL 2

Expert Comment

by:fremsley
ID: 6861289
Or, if you don't want to blow up your environment with
too many functions, you may create a script 'find' e.g. in
$HOME/bin like:

  #!/bin/sh
  /usr/bin/find / -name $1 2>/dev/null

and make that directory being the first one in your PATH --
at the end of $HOME/.bashrc

  export PATH=$HOME/bin:$PATH

Hope it helps
0
 

Author Comment

by:alphaomega232
ID: 6863028
Thanks to both of you
0

Featured Post

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question