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 7707775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:45+00:00 2026-06-01T00:26:45+00:00

This is a basic question but I am struggling to find a decent solution.

  • 0

This is a basic question but I am struggling to find a decent solution. This is hindering my script from automation.

I have the following path.

/home/hassan/Dyna/ProjectSimulation

in project simulation I have 3 folders

friction time force

like

/home/hassan/Dyna/ProjectSimulation/friction

Now I have a file friction1.txt in this friction folder and I want to copy it to ProjectSimulation.

is it possible to avoid complete path and just one step down?

Also if I have to copy this friction1.txt to folder force, is there anyway to avoid the complete path.

I mean I have a subroutine but this is path dependent , whenever I run it , I have to run in the same folder and then copy my results so I can run only one instance of my simulation.

Experts please guide me.

PS: This is part of a 600 lines shell.

  • 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-01T00:26:47+00:00Added an answer on June 1, 2026 at 12:26 am

    This comes across as so basic that I must have misunderstood something in your question.

    If you want to refer to a parent directory, .. is the way to do that. So, if you want to copy friction1.txt to two places you just do

    cp friction1.txt ..
    cp friction1.txt ../force
    

    All you need to take care of is making sure that CWD is

    /home/hassan/Dyna/ProjectSimulation/friction

    so that the references point at the right place.

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

Sidebar

Related Questions

I guess this is a basic question but I could not find the solution.
this is a real basic question but i was struggling at it from 30
I know this maybe a basic question but I just can't seem to find
I realize this is a basic question but I have searched online, been to
This is a really basic question but... I have some code like this var
This is a pretty basic question but I can't find a good answer for
This seems like a very basic question but I couldn't find any help on
This probably is a very very basic question but i can't seem to find
This is a basic question but unfortunately I could not find the relevant command
This might be very basic question to some but I am struggling for quite

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.