Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7965623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:12:45+00:00 2026-06-04T06:12:45+00:00

In our .net application we have to run file operation commands against Unix system.

  • 0

In our .net application we have to run file operation commands against Unix system. I am trying to have equivalent of File.Exists and Directory.Exists.

Using ssh in in .net, got to work so far in following way:

Find only files with matching name:

find /folder/subfolder -maxdepth 1 -type f -iname test.mov

Find only directories with matching name:

find /folder/subfolder -maxdepth 1 -type d -iname test

Question – Is it possible to do above operations without splitting full path?

It is not big deal to split the path but existing service in production accepts only command to run and the path.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:12:46+00:00Added an answer on June 4, 2026 at 6:12 am
    test -d  /path/to/directory_name  
    [ -d /path/to/directory_name  ] 
    

    return true or false – i.e. directory.exists

    test -f /path/to/filename
    [ -f /path/to/filename ]  
    

    same for files

    You can use these constructs to return ok or not ok

    [ -f /path/to/filename ]  && exit 0 || exit 1
    

    find does not return an error when it cannot find a named directory or file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a .NET application which targets .NET 3.5. Our clients run it from
In our Asp.Net Application we have an IHttpHandler handling requests for Images. The Handler
We have several choices for logging in our .NET (C#) server application. We are
in our application we have a Java applet running inside a .NET browser control.
I have a ADO.NET/TSQL performance question. We have two options in our application: 1)
We have a C# .Net client application that sends some commands via REST over
We have a .NET web application installed on our server at the location: C:\Inetpub\fmtool\
I'm a Silverlight/ASP.NET developer trying to write my first Windows Forms application to run
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
We are developing .net applications and using Clearcase for our SCM needs. We have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.