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

  • SEARCH
  • Home
  • 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 8473965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:29:55+00:00 2026-06-10T17:29:55+00:00

Is there a single, universal bash shell variable or common Linux command that will

  • 0

Is there a single, universal bash shell variable or common Linux command that will reliably indicate if a given directory or file is on a remote filesystem — be it NFS, SSHFS, SMB, or any other remotely mounted filesystem?

CONTEXT…
This a root-only access, single-user, multi-host Linux development “lab” using SSH and SSHFS for semi-seamless loose-coupling the systems. Relevent directory structure on each host is…

    /0
    /0/HOST1
    /0/HOST2
    /0/HOST3
    /bin
    /boot
      :

Directories in /0 are SSHFS mounted to ‘/’ on the named host. ‘Host1’, etc. are mountpoint directories named for each host.

I could of course, establish an environment variable something like…

    REMOTE_FS=/0

…and test for the dirname starting with ‘/0’. However that’s not very portable or reliable.

Obvious question…
Having made the effort to make it seamless, why do I want to know when accessing something non-local?

Answer…
Going through a mounted filesystem puts all the processing load on the initiating host. I’d like to know when I have the option of using SSH instead of SSHFS to offload the background processing (ls, grep, awk, etc) to the remote (and usually more powerful) host, leaving just the GUI and control logic on the local machine.

  • 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-10T17:29:56+00:00Added an answer on June 10, 2026 at 5:29 pm
    df -l <file>
    

    This will return a non-zero exit code if the file or directory is not local.

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

Sidebar

Related Questions

is there a single select statement that will do all three of those: primary
Is there any single magic preamble that will make a Perl script run under
Is there a single preprocessor token that can be used to detect any iPhone
Is there a single method that returns the list of items contained in a
Short and sweet version: Is there a single web service method that would return
Given a table like below, is there a single-query way to update the table
I'm curious - is there a single Matlab command to return the elements in
Is there a single algorithm that removes elements from a container as happens in
Is there a single-byte charset (e.g. ISO-8859-x) that matches the first 256 unicode characters
Is there a single function in R that determines if a value is NA

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.