Hi, Can I access standard Linux Commands whilst running DietPi (headless) and, if so, how?
* I am at the start of my Linux knowledge journey (like just about every other aspect of software development) and have decided to give DietPi a go. I've managed to install and get started - headless from my MacBook Air.
* Now I want explore things like switching the user account (e.g. from DietPi to Root) and how to shutdown the system gracefully. I was hoping to be able to enter standard Linus Commands through SSH from my Mac terminal. But I've not found a way of achieving this.
Accessing Linux Commands Topic is solved
Re: Accessing Linux Commands
Use an ssh client to connect to the dietpi device. The default user is root and password dietpi.
Re: Accessing Linux Commands
Hi,
many thanks for your message. Yes it's simple like this. Just get a SSH client, connect to your system, login and complete initial setup. Below you can find link to our installation as well as user guide.
https://dietpi.com/docs/user-guide_installation/
https://dietpi.com/docs/user-guide_overview/
many thanks for your message. Yes it's simple like this. Just get a SSH client, connect to your system, login and complete initial setup. Below you can find link to our installation as well as user guide.
https://dietpi.com/docs/user-guide_installation/
https://dietpi.com/docs/user-guide_overview/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Accessing Linux Commands
Thanks @Joulinar and @trendy .
My difficulty is not accessing the Pi through SSH but accessing standard Linux Commands - for example 'Shutdown'.
Please see attached screenshot as an example.
I look forward to further advice.
My difficulty is not accessing the Pi through SSH but accessing standard Linux Commands - for example 'Shutdown'.
Please see attached screenshot as an example.
I look forward to further advice.
Re: Accessing Linux Commands
You are trying to use the man command which is not available on a fresh DietPi images. If you want to check, if a command is available, you could do:
which ls
or
command -v ls
or simply execute it
:
If you need to see the man pages, I personally prefer to do that on a desktop browser where additional resources are shown:
- https://manpages.debian.org/ls
- https://manpages.debian.org/shutdown
If you really need to see the man pages on console, install the related package. Generally to find packages required to gain a certain command, the online man page site helps with this as well: https://manpages.debian.org/man
Note at the top: / buster / man-db / man(1)
Means the man command on Buster is available via man-db package. Hence do:
which ls
or
command -v ls
or simply execute it

If you need to see the man pages, I personally prefer to do that on a desktop browser where additional resources are shown:
- https://manpages.debian.org/ls
- https://manpages.debian.org/shutdown
If you really need to see the man pages on console, install the related package. Generally to find packages required to gain a certain command, the online man page site helps with this as well: https://manpages.debian.org/man
Note at the top: / buster / man-db / man(1)
Means the man command on Buster is available via man-db package. Hence do:
Code: Select all
apt install man-db
man ls
Re: Accessing Linux Commands
yep indeed. Using man will bring the use manual. To have the command executed, just use the command without man in front.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Accessing Linux Commands
@MichaIng , many thanks for your very helpful reply. With that information some pieces of a 'newbie's' puzzle slotted into place. I subsequently went on a learning journey that has made me more comfortable getting around the directory structure using ssh. The command is very helpful. And I also proceeded to encounter:

Code: Select all
which
- which seems to give a slightly lighter weight version of a Man page, for available commands
Code: Select all
--help
- This GNU resource: https://www.gnu.org/software/coreutils/ and its online manual (in addition to the debian one you have pointed me to.

Re: Accessing Linux Commands
Great to hear
. Yes --help or -h works in very most cases. Also when you start entering a command and hit the <tab> character, bash (the console shell) will show you available commands starting with what you just typed character(s), or if there is only one result, will auto-complete.
The same works when you have entered a command (completely, or used auto-complete), a space, and hit <tab>, for most commands available sub-commands are shown, if not supported, then at least the files+dirs of the current directory, which you may anyway wanted to select (for cd, nano or such). When you type one or two dashes and <tab>, you'll see available command options in most cases.
This is thanks to bash-completion (and a bit basic bash features) which may save a lot of time, searching, copy&paste
.

The same works when you have entered a command (completely, or used auto-complete), a space, and hit <tab>, for most commands available sub-commands are shown, if not supported, then at least the files+dirs of the current directory, which you may anyway wanted to select (for cd, nano or such). When you type one or two dashes and <tab>, you'll see available command options in most cases.
This is thanks to bash-completion (and a bit basic bash features) which may save a lot of time, searching, copy&paste
