Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
75
rated 0 times [  75] [ 0]  / answers: 1 / hits: 41091  / 3 Years ago, fri, may 21, 2021, 5:06:48

may be it seems strange for you, but I want to run command in a specific folder without changing the current folder in the shell. Example - this is what I usually do:



~$ cd .folder
~/.folder$ command --key
~/.folder$ cd ..
~$ another_command --key


Though I want something like this:



~$ .folder command --key
~$ another_command --key


Is it possible?


More From » bash

 Answers
0

If you want to avoid the second cd you can use



(cd .folder && command --key)
another_command --key

[#27346] Saturday, May 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sertold

Total Points: 445
Total Questions: 123
Total Answers: 113

Location: Burundi
Member since Wed, Sep 28, 2022
2 Years ago
sertold questions
Wed, Dec 21, 22, 16:02, 1 Year ago
Fri, Dec 31, 21, 01:50, 2 Years ago
Thu, Jun 16, 22, 23:30, 2 Years ago
Mon, Mar 7, 22, 16:21, 2 Years ago
Tue, Mar 29, 22, 02:11, 2 Years ago
;