Monday, April 29, 2024
43
rated 0 times [  43] [ 0]  / answers: 1 / hits: 66045  / 3 Years ago, thu, june 24, 2021, 3:01:35

I was recently in a predicament where I was inside a folder, and I wanted to cd to a sub directory folder. There was only one folder, inside this folder and it was a really long name.



Home (I am here)
|
|
--> /reallylongnamefolder


Is there any way of going into that folder instead of typing out:



 cd reallylongnamefolder

More From » command-line

 Answers
0

I would advice either to type first few letters and pressing tab. Bash has autocomplete feature that is really useful. If it is only directory in in current path just pressing tab will fill whole directory.



Typing in cd and pressing tab twice will display all options in current directory.



tab is generally really useful in bash as you have accessible almost all executables at one or two keypresses.



cd * as suggested above works only if the directory is first in the listing and not hidden. If there is file alphabetically before your directory this cd won't change your directory at all.


[#25695] Saturday, June 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sipwing

Total Points: 245
Total Questions: 100
Total Answers: 118

Location: Aland Islands
Member since Thu, Oct 22, 2020
4 Years ago
sipwing questions
Sun, May 29, 22, 22:00, 2 Years ago
Fri, Jun 24, 22, 08:46, 2 Years ago
Fri, Dec 23, 22, 00:04, 1 Year ago
;