$ cd ..
$ ls
$ cd ..
$ ls
"hmm yes.. everything seems to be in order"
Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
sudo
in Windows.Please report posts and comments that break these rules!
Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.
$ cd ..
$ ls
$ cd ..
$ ls
"hmm yes.. everything seems to be in order"
I need a shell/plugin/tool/whatever that always shows me the content of the current dir in a little popup or something.
Anything I do in the shell is like cd this, ls, cd there, ls *, I feel like a have the navigational awareness of a amnesiac goldfish
A window, you say!?
Put this in bashrc or whatever flavour of shells's bashrc you use:
function cs () { cd "$@" && ls }
I didnt remember the function sintax of bash so I just copied it from SO.
cs () {
cd $1;
ls ${@:2}
}
You (probably) only want to pass the first argument to cd
, this'll send the rest to ls
.
You probably want rangerfm or vifm. They use miller columns for to show you your surrounding context.
Alternatively, you could use a TUI file manager. Once you get the navigation down you can manage things pretty quickly. Especially with ones that have options for dual directory layouts, like Midnight Commander or vifm.
cd ..
pwd
ls
ls -a
tree -d
git status -bs
cd ..
...
I ain't reading allat
Then you invite chaos to sit in your lap, friend
alias ..='cd ..' #: up one directory
alias ...='cd ../..' #: up two directories
The first two options (autocd
and cdspell
) have been a lifesaver in fixing my frustrations with the default bash
settings (and even lets me stick with bash, instead of feeling I should move to zsh or any other shell.
I can just type a foldername, tabcomplete it and press enter to go there. It's great.
# == shopts ==
# https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
shopt -s autocd # cd into folder without cd, so 'dotfiles' will cd into the folder
shopt -s cdspell # attempt spelling correcting on folders
shopt -s direxpand # expand a partial dir name
shopt -s checkjobs # stop shell from exit when there's jobs running
shopt -s dirspell # attempt spelling correcting on folders
shopt -s expand_aliases # aliases are expanded
shopt -s histappend # append to the history file, don't overwrite it
shopt -s histreedit # lets your re-edit old executed command
shopt -s histverify # I'm confused.
shopt -s hostcomplete # performs completion when a word contains an '@'
shopt -s cmdhist # save multiple-line command in single history entry
shopt -u lithist # multi-lines are saved with embedded newlines rather than semicolons; explictly unset
shopt -s checkwinsize # update LINES and COLUMNS to fit output
In your rc:
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
Usage:
1/2/3 $ ...
1 $
That's pretty neat
alias cd..='cd ..'
alias cd...='cd ../..'
alias cd....='cd ../../..
alias cd.....='cd ../../../..'
Then forget all that and just use
cd ~
or cd /
No need for ~
- just cd
works as well.
.....
for zsh users
Excuse me what? I've been multi cd'ing for years like a chump?
for i in { 1..4 }; do cd ..; done
i use fish shell with https://github.com/nickeb96/puffer-fish
basically when i type ...
it expands to ../..
and adds another /..
for every additional dot i type
its similar to what the zsh users in the comment section are doing
cd .. ls cd .. ls cd .. ls cd .. ls
Try zoxide
Installing zoxide led me to installing fzf, which has improved my terminal experience by about 35%, I already installed it in all the machines I'm managing
Got any more tools? :)
I can recommend featureful terminal emulator Kitty. I'd been using tmux and screen for over a decade, but now just get that functionality baked into the terminal. The only time I use tmux now is for remote sessions.
I am tmuxed all the time, the idea of integrating it into the terminal is interesting. I'll need to think about it, thanks for the suggestion :)
I alias ..
to cd ..
Works for me π€·π»
I do that too!
I also alias ...
to cd ../..
. I'll be honest, I often forget to do it, but in theory it can speed things up.
cd .. && ls
!!
!!
!!
!!
What's so surprising?? What did you see in that dir??
Double-bang repeats the previous command. Great if you forget sudo
.
$ rm -rf <folder>
permission denied
$ sudo !!
I use a lot cd -
(go to previous) or just cd
to go home.
cd ..
!!
!!
!!
Easiest solution, use fish instead of bash! Default fish keybindings will allow you to just type . . or name a directory similar to how you could do with Zoxide.
Also, wait until you find about pushd and popd ;)
.....
Me doing it the worst way > opening up dolphin(file explorer) navigating to the folder then opening terminal there.