$ 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
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 tols
.Did that years ago, just called it cds. I also have an “up” command which is an alias to “cds …”. Oh, and I have a “setup server_name” they copy all my aliases to a server and create an alias that allow me to “ssh -A server_name” using only server_name.
You probably want rangerfm or vifm. They use miller columns for to show you your surrounding context.
that, or you have to make ABSOLUTELY SURE that you haven’t accidentally pressed a button on your keyboard that has inevitably resulted in the total destruction of the directory contents
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.
A window, you say!?
It is called windows 2000 explorer and it’s great for file operations :) In Linux i have yet to find a really good replacement ;(
What’s a GUI?
Try Dolphin. Press F4 to open the terminal view. It stays in dync with the gui so if you use cd in the terminal, the contents of the new folder will be shown.
That sounds really cool but I spent so much time making things look pretty …
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
Sometimes I throw off the linux admin reading my log by throwing in a pwd before going to the next one. Know it’s not gonna be in that directory you know?
pwd
seems more appropriate thanls
Doesn’t let you rifle through things approvingly as you go. "Yes this is the correct directory because it has the three files I was looking at earlier–
You know what let’s do a ls -al just to be super sure it’s the right modification
fair point
In your rc: alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' Usage: 1/2/3 $ ... 1 $
That’s pretty neat
Or just use zsh
Yeah, let’s use whole different shell, because you can’t add some few aliases to your
.bashrc
.That’s not why I use a whole different shell. It just happens to be a perk of the one I use.
This is the way.
cd .. !! !! !!
I use a lot
cd -
(go to previous) or justcd
to go home.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 ;)
You forgot the pwd after each ‘cd’.
ls*
Ls doesn’t tell them where they are, just what files exist in their current location.
Yup,
But I want to know if the file I’m looking for is in this directory or I have to cd… once more
That’s when locate piped to grep is your best friend.
for i in { 1…4 }; do cd …; done
alias ..='cd ..' #: up one directory alias ...='cd ../..' #: up two directories
The first two options (
autocd
andcdspell
) have been a lifesaver in fixing my frustrations with the defaultbash
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
Wait until we tell them about autojump
Depending on where you are, maybe just “cd”.
Smh when are you going to upgrade to dvd
The
history
of the CTO at a previous job was filled withdc
andsl
because he was a fucking moron. Yes I’m still bitter that he earned way more money than me who had to fix all his mess.You could have gifted him some silly fun with the
sl
package.
Why no cd /////// speceficterm if you know how deep it is
Those are supposed to be stars. I’m not fixing this on a phone
cd…
bind '"^H":"cd ..^M"'
Nah, I always
cd
to full path, that way I can easily use my history to move back there