Accessing Linux Commands Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
dagmarian
Posts: 3
Joined: Thu Nov 05, 2020 4:31 am

Accessing Linux Commands

Post by dagmarian »

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.
User avatar
trendy
Posts: 152
Joined: Tue Feb 25, 2020 2:54 pm

Re: Accessing Linux Commands

Post by trendy »

Use an ssh client to connect to the dietpi device. The default user is root and password dietpi.
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Accessing Linux Commands

Post by Joulinar »

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/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dagmarian
Posts: 3
Joined: Thu Nov 05, 2020 4:31 am

Re: Accessing Linux Commands

Post by dagmarian »

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.
Attachments
Screenshot 2020-11-05 at 19.26.16.png
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Accessing Linux Commands

Post by MichaIng »

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:

Code: Select all

apt install man-db
man ls
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Accessing Linux Commands

Post by Joulinar »

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
dagmarian
Posts: 3
Joined: Thu Nov 05, 2020 4:31 am

Re: Accessing Linux Commands

Post by dagmarian »

@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

Code: Select all

which
command is very helpful. And I also proceeded to encounter:
  • Code: Select all

    --help
    which seems to give a slightly lighter weight version of a Man page, for available commands
All in all a great learning experience. I am grateful for the responsiveness and helpfulness of this forum. About 72 hrs after jumping in with DietPi I feel really quite comfortable with the base setup.
:)
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Accessing Linux Commands

Post by MichaIng »

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 :).
Post Reply