to create aliases in your shell, you shall use the alias shell directive:
alias reboot='sudo reboot'
alias ax='sudo ps ax'
To run ps ax you do not need to sudo first. If you're running a standard kernel, any user can see the list of all processes without special privileges.
For the two python aliases:
alias runstepper='python home/pi/mystepper6.py'
alias moveit='sudo python home/pi/moveit.py'
^-- missing / here
do not forget about the first / in the path, or whenever you launch the aliased command, you'll have python look up for the script relatively to the current directory. i.e. if you're in /home/pi, it will look it up into /home/pi/home/pi/movestepper6.py and tell you the script does not exists. So the proper command should be:
alias runstepper='python /home/pi/mystepper6.py'
alias moveit='sudo python /home/pi/moveit.py'
Though as a suggestion to you, instead of making aliases to run python scripts, I'd make them into a proper python package. Considering that within both codes your entry points are a function called main(), i.e., both scripts end with:
if __name__ == "__main__":
main()
you should create a directory for your project:
cd /home/pi
# create a directory for your python project:
mkdir motion_control
# create a directory to place your scripts within:
mkdir motion_control/motion_control
# adding an empty __init__.py file makes that directory a python package
touch motion_control/motion_control/__init__.py
nano motion_control/setup.py
and now you just have to add this within the setup.py file:
from setuptools import setup
setup(name='motion_control',
version='0.1',
description="Python library to operate stuff that move on my rasppi",
long_description='explain how to use the tools installed by this package',
classifiers=[],
keywords='raspberrypi motion control',
author='YOU',
author_email='YOUR@EMAIL',
url='ANY URL YOU THINK IS RELEVANT',
license='MIT', # or any license you think is relevant
packages=['motion_control'],
zip_safe=False,
install_requires=[
# add here any tool that you need to install via pip
# to have this package working
'setuptools',
],
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runstepper = motion_control.mystepper6:main
moveit = motion_control.moveit:main
""",
)
the entry_points part is very important, as it's telling python where to look for the first function to execute to have the script run. For example:
moveit = motion_control.moveit:main
means "look for the main() function within the moveit module in the motion_control package". So adapt accordingly! As a note: don't make that main() function take any parameter, but rather do the argument parsing within it (if you parses arguments).
and finally, to install it, all you need to do is:
cd motion_control
sudo python setup.py install
and you'll have runstepper and moveit installed in the same directory as your python executable.
HTH
reboot='sudo reboot'works is quite unexpected.rebootwork.