b9AcE #NoEdits on Nostr: A devious feature of the BASH-shell and related on UNIX(/Linux) systems is the ...
A devious feature of the BASH-shell and related on UNIX(/Linux) systems is the "alias"-command.
Many are e.g. used to defaults like being able to type "ll"+<enter> to get a "long listing" of the files in a directory (later often idiotically renamed "folder" for confusion),
whilst that usually actually just like a "shortcut" for the command "ls" ("list sources", because UNIX was built by programmers, wanting to list their programming "source files"),
buuut, that "shortcut" can also be used to e.g. make entering a simple command like "ls" do unexpected things like remove ("rm") files and directories.
This is the power of the "alias"-command, which just reroutes whatever you wrote on the command-line to do something else.
In the case of the previous "ll", a common way it was set in you login-initialization files is "alias ll='ls -al'",
but that cooould be changed by someone devious to run actually any other command.
SO, if you want to be safe, you can tell your command-line to run the command "ls" with its full path "/bin/ls", but that CAN be caputured too, so you can escape that by the "escape"-character backslash,
so now it becomes "\/bin/ls" for full safety.
If it's a command built into the shell, you instead start by for example "\builtin alias la='\/bin/ls -halF --color=force'".
:-)
Many are e.g. used to defaults like being able to type "ll"+<enter> to get a "long listing" of the files in a directory (later often idiotically renamed "folder" for confusion),
whilst that usually actually just like a "shortcut" for the command "ls" ("list sources", because UNIX was built by programmers, wanting to list their programming "source files"),
buuut, that "shortcut" can also be used to e.g. make entering a simple command like "ls" do unexpected things like remove ("rm") files and directories.
This is the power of the "alias"-command, which just reroutes whatever you wrote on the command-line to do something else.
In the case of the previous "ll", a common way it was set in you login-initialization files is "alias ll='ls -al'",
but that cooould be changed by someone devious to run actually any other command.
SO, if you want to be safe, you can tell your command-line to run the command "ls" with its full path "/bin/ls", but that CAN be caputured too, so you can escape that by the "escape"-character backslash,
so now it becomes "\/bin/ls" for full safety.
If it's a command built into the shell, you instead start by for example "\builtin alias la='\/bin/ls -halF --color=force'".
:-)