LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 05-13-2014, 09:11 PM   #16
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,142
Blog Entries: 21

Rep: Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480Reputation: 3480

My bad then evo2.

Code:
sudo shutdown
Code:
sudo reboot
works in AntiX. Without a password even.

as root

Code:
shutdown -h now
has never failed me in anything but maybe puppy. Yep, Just checked in Slack0 5.7 puppy and no shutdown command found.

Code:
shutdown -r now
is pretty standard across distros for reboot except Puppy.

inxi for me has never hurt to install and run was why I thought it would be OK for what the OP wanted.
 
Old 05-14-2014, 01:56 AM   #17
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
How do I test test what commands are available ?

Andy
 
Old 05-14-2014, 02:27 AM   #18
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by Fixit7 View Post
How do I test test what commands are available ?
you can start by using "which". For example if you wanted to see if wmpoweroff exists you could do;
Code:
which wmpoweroff > /dev/null 2>&1
if [ "$?" = "0" ] ; then
  echo "This system has wmpoweroff"
else
  echo "This system does not have wmpoweroff"
fi
The key points here are that the "which" command will exit with status "0" if it finds the command and status "1" if not and that the value of the exit status of last command run is always stored in the variable called "$?".

HTH,

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which LXDE version of Linux has the newest version of Firefox and Open Office? coolguy2008 Linux - Newbie 6 09-19-2010 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 07:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration