Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:08:14+00:00 2026-06-18T04:08:14+00:00

In UNIX, I read that moving a shell script to /usr/local/bin will allow you

  • 0

In UNIX, I read that moving a shell script to /usr/local/bin will allow you to execute the script from any location by simply typing “[scriptname].sh” and pressing enter.

I have moved a script with both normal user and root permissions but I can’t run it.

The script:

#! bin/bash

echo "The current date and time is:"
date

echo "The total system uptime is"
uptime

echo "The users currently logged in are:"
who

echo "The current user is:"
who -m

exit 0

This is what happens when I try to move and then run the script:

[myusername@VDDK13C-6DDE885 ~]$ sudo mv sysinfo.sh /usr/local/bin

[myusername@VDDK13C-6DDE885 ~]$ sysinfo.sh

bash: sysinfo.sh: command not found
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:08:15+00:00Added an answer on June 18, 2026 at 4:08 am

    If you want to run the script from everywhere you need to add it to your PATH. Usually /usr/local/bin is in the path of every user so this way it should work.
    So check if in your system /usr/local/bin is in your PATH doing, on your terminal:

    echo $PATH 
    

    You should see a lot of paths listed (like /bin, /sbin etc…). If its not listed you can add it. A even better solution is to keep all your scripts inside a directory, for example in your home and add it to your path.

    To add a directory in your path you can modify your shell init scripts and add the new directories, for example if you’re usin the BASH shell you can edi your .bashrc and add the line:

    PATH=$PATH:/the_directory_you_want_to_add/:/another_directory/
    

    This will append the new directories to your existing PATH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i write a program using STANDARD UNIX UTILITIES that will read data
I read that Linux kernel is preemptive, which is different from most Unix kernels.
I have two (UNIX) programs A and B that read and write from stdin/stdout.
I am trying to create a simple shell in Unix. I read a lot
IF(UNIX) # CROSS COMPILATION! ON/OFF #SET(CMAKE_C_COMPILER /home/username/projects/buildroot/output/host/usr/bin/arm-linux-gcc) #SET(CMAKE_CXX_COMPILER /home/username/projects/buildroot/output/host/usr/bin/arm-linux-g++) #SET(CMAKE_C_COMPILER /home/username/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc) #SET(CMAKE_CXX_COMPILER /home/username/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-g++) here
I read that on Unix systems, malloc can return a non-NULL pointer even if
I read in my unix text book that bss is used to store the
I am currently writing an application that read frames from camera, modify them, and
I have the following bash script (.sh) that's working just fine in Unix. I'd
I need to write a simple terminal-based program that should, Read some text from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.