▲ 42 ▼ What are some of your most useful or favorite terminal commands? (literature.cafe) submitted 10 months ago by cm0002@literature.cafe to c/linux@programming.dev 45 comments fedilink hide all child comments OQB @marighost@piefed.social
[–] deifyed@lemmy.wtf 6 points 10 months ago (2 children) Maybe "alias u=cd .." or "alias mkcd=mkdir -p $1 && cd $1" permalink fedilink source hideshow 2 child comments replies: [–] hallettj@leminal.space 2 points 10 months ago I like mkcd! I have the same thing. Although what I use more is a function I pair with it that specifically creates a temporary directory, and cds to it. It's useful for temporary work, like extracting from a zip file. These are my Nushell implementations: # Create a directory, and immediately cd into it. # The --env flag propagates the PWD environment variable to the caller, which is # necessary to make the directory change stick. def --env dir [dirname: string] { mkdir $dirname cd $dirname } # Create a temporary directory, and cd into it. def --env tmp [ dirname?: string # the name of the directory - if omitted the directory is named randomly ] { if ($dirname != null) { dir $"/tmp/($dirname)" } else { cd (mktemp -d) } } permalink fedilink source parent [–] deifyed@lemmy.wtf 1 point 10 months ago Totally forgot my favorites. C=clear, vi=nvim, l=eza -lh permalink fedilink source parent
[–] hallettj@leminal.space 2 points 10 months ago I like mkcd! I have the same thing. Although what I use more is a function I pair with it that specifically creates a temporary directory, and cds to it. It's useful for temporary work, like extracting from a zip file. These are my Nushell implementations: # Create a directory, and immediately cd into it. # The --env flag propagates the PWD environment variable to the caller, which is # necessary to make the directory change stick. def --env dir [dirname: string] { mkdir $dirname cd $dirname } # Create a temporary directory, and cd into it. def --env tmp [ dirname?: string # the name of the directory - if omitted the directory is named randomly ] { if ($dirname != null) { dir $"/tmp/($dirname)" } else { cd (mktemp -d) } } permalink fedilink source parent
[–] deifyed@lemmy.wtf 1 point 10 months ago Totally forgot my favorites. C=clear, vi=nvim, l=eza -lh permalink fedilink source parent