DEV Community

Discussion on: Basic UNIX commands

Collapse
 
vsanjo profile image
David Woodward • Edited

If you're finding yourself attacking those annoying commands often, consider setting an alias for them!

Instead of typing ls -AbcClhoG, you could alias all that into ll.

First thing's first, assuming you're using bash/sh and not zsh or variants (use which $SHELL to figure that out!), run nano ~/.bashrc to start editing your config for the shell.

You'll then want to add an alias at the bottom now, using alias ll="ls -AbcClhoG". Easy!

Ctrl + C, Y, Y to save and exit nano, and you'll want to source ~/.bashrc or make a new tab in Terminal to reload your settings.


You can run any commands and name them however you want - even chaining them as you go.

command & command will run them concurrently, whilst command && command will run each individually assuming the last command succeeds. command & will leave the task running indefinitely, so be careful (you can always Ctrl + C out of it).

Collapse
 
cannuhlar profile image
Can Nuhlar • Edited

Or you can press Ctrl + Z after you do command & to run it as a background job.