10

I want to describe a situation that happened two levels earlier. I use the bash shell to navigate through directories.

Say I started at the directory /home, and then I moved to the directory /home/Downloads, and finally I moved to /home/Videos.

Now I'll describe how to navigate to earlier directories:

To go to the previous directory type cd -. And to go to the previous of previous directory type cd --

As you notice, previous of previous sounds odd.

Is there a replacement word for "previous of previous"? Or how would you paraphrase it to make it sound grammatical?

  • 3
    To go to the previous directory type cd -. And to go to the directory before, type cd -- – Tushar Raj Jul 9 '15 at 17:54
  • 2
    Parent and grandparent? – deadrat Jul 9 '15 at 18:04
  • 4
    @kenn: Ordinality? Sorry man, but we don't speak math. The closest English could get you would be 'grandprevious'. Try Math.SE or Stackoverflow – Tushar Raj Jul 9 '15 at 18:05
  • 1
    @deadrat: Jinx. – Tushar Raj Jul 9 '15 at 18:06
  • 1
    @CRDrost You are right about that. I don't know how I acquired that misconception, I used to use some bash functions to navigate between directories, I might think that cd -- take you to antepenaltimate directory, but it's wrong for bash environment. cd -- takes you to $HOME directory. – kenn Feb 27 at 17:02
11

antepenultimate - Two before the last. Penultimate is just before the last. Before the penultimate is antepenultimate.

Some shells will allow you to use the up arrow to recall the last command, so I call antepenultimate, up-up-up.

  • You appear to get my point but your approach is rather fantastic. – kenn Jul 9 '15 at 19:19
  • 2
    correct answer here – chiliNUT Jul 9 '15 at 22:30
  • I was just thinking anteprior should be a word. – stevesliva Jul 9 '15 at 22:30
  • For the sake of completeness: there used to be a preantepenultimate meaning third before last. – Jesvin Jose Jul 10 '15 at 14:41
10

penultimate or next-to-last or second-to-last.

Ultimate means last, penultimate means next-to-last.

That can refer to latest instead of last, but I guess that is what you are after here, since your example seems to suggest chronological access.

Last can mean many things, but next-to-last always refers to, well, the thing that is prior to the last one, however last is meant. IOW, whatever ordering is used to define last, the same ordering handles next-to-last correctly.

(If you mean only moving up the directory hierarchy, then parent and grandparent are appropriate.)

  • Drew, the word I was trying to bring up was next-to-last It sounds well. But what about the third, the fourth level directories? How would you define them? – kenn Jul 9 '15 at 18:18
  • 8
    Neither of the suggestions here works in the context given. Both the paenultimate and the next-to-last directory would be one that appears just before the very last directory in a directory listing. It doesn’t work for a directory that is two steps back through your browsing history. – Janus Bahs Jacquet Jul 9 '15 at 18:26
  • @JanusBahsJacquet I'd like to see your answer too. – kenn Jul 9 '15 at 18:30
  • 1
    @kenn pointing out that an answer is incorrect does not imply that one can think of a correct answer. This is especially true if there is no correct answer, which I am inclined to think is the case here. – phoog Jul 9 '15 at 18:53
  • 2
    @JanusBahsJacquet I don't believe next-to-last carries a universal context; if the task is moving backwards through history, next-to-last accurately describes the place I was before the last place I was before now. – Mathletics Jul 9 '15 at 20:58
8

You may need something like the one before last:

Do X to go to the last [or previous] directory; do Y to go to the one before last.

Here's an example:

The two last chapters, which were not covered in the course proper, are perhaps less easily accessible: the one before last because it is rather technical, the last one because it requires some (elementary) knowledge of analytic (or algebraic) complex geometry.

(Complex Tori and Abelian Varieties, p. vii; emphasis added)

  • I don't think I can use it in my case, because the ultimate directory is not known. – kenn Jul 9 '15 at 18:26
  • 5
    Instead of last, just use that: “Do X to go to the previous directory; do Y to go to the one before that”. Or alternatively, “Do X to go back one step; do Y to go back two steps”. – Janus Bahs Jacquet Jul 9 '15 at 18:27
  • @kenn It's used for chronological or logical sequence: the current directory is the one you're in right now; the last is the one you were in before now; the one before last is the one you were in before that. – Matt Gutting Jul 9 '15 at 18:28
  • @MattGutting this use of "last" is ambiguous and can be confusing. If you are at the 8th station of a transit line having 10 stations, and you just arrived from the 7th station, the phrase "last station" could denote the 7th station or the 10th. – phoog Jul 9 '15 at 18:57
7

Why not just say previous but one (or previous bar one)?

I find it self-explanatory (in analogy to last but one). Google gives me quite a lot of hits in exactly the requested sense. Example:

The core principle of renku is “link and shift”. “Link” signifies that each verse links somehow to its predecessor and “shift”, by contrast, means that each new verse must shift away from the previous-but-one verse, and have nothing in common with it. Thus, in any three consecutive verses A, B and C: B is to link to A and C links to B, but crucially C shifts right away from A.

(HAIKU SPIRIT: Guidelines to compose a renku, emphasis mine)

5

I don't know of any commonly used terminology, but to specify this with ordinality you could use first antecedent (for cd -), second antecedent (cd --) and so on.

In the context of bash, you could perhaps go for second last history entry (cd --) etc, though since you seem to limit this to cd commands that is not quite right either. Second last directory visited perhaps?

  • Alok, your approach is smartly. It grammatically sounds well. – kenn Jul 9 '15 at 18:35
  • 1
    @kenn unsolicited grammar advice: read up on copulative verbs (linking verbs). In both of your sentences, the last word should be an adjective, not an adverb (smart, good). Because of the nature of the verb, the word in that position describes the subject, not the verb. – phoog Jul 9 '15 at 19:01
  • @phoog thank you for correcting me. I ll never master English. By the way if you keep correcting my grammar errors you ll end up with proving infinite set theory – kenn Jul 9 '15 at 19:30
  • @kenn this is a mistake that many naive speakers make, generally not with to be but with others like sounds, looks, etc. One sentence to illustrate: A wet dog smells well, but a wet dog smells bad. – phoog Jul 9 '15 at 19:34
  • I thank you all who posted an answer or commented on my topic. I should pick up one of the answers here. Alok's answer looks functional though it sounds a bit unfamiliar at first glance. Since nobody criticise his answer I ll accept it. But I had better wait a while. – kenn Jul 10 '15 at 10:26
3

Wouldn't you be able to say, "the directory prior to the previous directory', etc. I'm not sure if it's mathematically clear, but it would be very clear to me if I were the user who was trying to follow your instructions.

  • You are right in that context. It's possible to define it in a number of ways semantically. I wondered if there were any ordinal phrase I could replace previous of previous – kenn Jul 9 '15 at 19:17
2

Before, or two before

In fluent English you'd probably say, "Use cd - to go to the last directory, or cd -- to get to the one before that." You can then refer to it inline as the "before-last" directory.

You should also consider describing them with reference to the present directory as the directory before and the directory two before the current one. If you need to scale to larger numbers, you should definitely use this: it has the distinct advantage that you can refer to the directory fifty-eight before the current directory, and nobody has any ambiguity about what that means. The equivalent "previous-of-previous-of-previous-of..." will be unsustainable after 5 or 6 iterations.

  • Chris, I think you are a programmer and native English speaker. You presented a universal way to describe ordinality too. It's clear and precise. – kenn Jul 10 '15 at 18:01
  • @CR Drost: Not relevant to the OP's question but Chris are you sure cd -- works as you said ? – digital_infinity Feb 25 at 14:39
  • @digital_infinity I mean it probably depends on what shell you're using but at least in Bash and Zsh it appears to do that: bash-3.2$ pwd /Users/cdrost bash-3.2$ cd /tmp bash-3.2$ cd /var bash-3.2$ cd -- bash-3.2$ pwd /Users/cdrost – CR Drost Feb 26 at 18:04
  • @CR Drost. -- means usually in gnu commands: "stop reading options, the following arguments are file names, not options". In your case there is zero following arguments so cd -- is equal to cd. It is interpreted as "go the user's home directory". See (unix.stackexchange.com/questions/11376/…) and (askubuntu.com/questions/711390/…) – digital_infinity Feb 27 at 11:08
  • @digital_infinity oh, now that is interesting. I thought bare cd didn't change your directory. You're right that my test was inadequate and they do in fact take us back to the home directory. – CR Drost Feb 27 at 16:23
0

Instead of previous use, "one level up", previous of previous use "two levels up". unless is going back in to navigation history, then this would not work.

  • 1
    Per the Bash documentation, "If directory is ‘-’, it is converted to $OLDPWD". OLDPWD is "The previous working directory as set by the cd builtin.". It's not the parent directory; it's the previous directory. – recognizer Jul 10 '15 at 17:01
  • @recognizer Yes, you are right about it. Thank you for clarification. Some posts such as parent, grandparent directory get meaningless. But montelof's approach is logical. He paraphrases the sentence. – kenn Jul 10 '15 at 17:11
  • in that case it could be history -1, History -2, History -3, etc. or just print the path as it would be. instead. like /home/Downloads, /home/Videos. and thats it. – montelof Jul 21 '15 at 19:13
-1

I'm not a programmer, but in any other context, I would probably use "former" and "latter".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.