F5F Stay Refreshed Software Operating Systems Modify a linux command

Modify a linux command

Modify a linux command

Pages (2): 1 2 Next
T
TheWarlord23
Member
194
06-28-2023, 06:27 AM
#1
Looking for ways to alter Linux commands and enhance their capabilities? Let me know!
T
TheWarlord23
06-28-2023, 06:27 AM #1

Looking for ways to alter Linux commands and enhance their capabilities? Let me know!

9
992x
Senior Member
506
07-05-2023, 04:32 AM
#2
Download the source code, make your modifications, and then recompile it.
9
992x
07-05-2023, 04:32 AM #2

Download the source code, make your modifications, and then recompile it.

P
penguinwrld
Junior Member
18
07-05-2023, 12:00 PM
#3
You can locate source code for commands like ls and poweroff in documentation or repositories related to the operating system you're using. Check official developer websites, community forums, or package managers for references.
P
penguinwrld
07-05-2023, 12:00 PM #3

You can locate source code for commands like ls and poweroff in documentation or repositories related to the operating system you're using. Check official developer websites, community forums, or package managers for references.

M
MEEKA2002
Member
67
07-05-2023, 12:29 PM
#4
Determine the package it is part of, then locate its source code repository. For instance, basic tools like `ls` come from the GNU coreutils package, available at http://git.savannah.gnu.org/cgit/coreutils.git/tree/src, where you can view the file at http://git.savannah.gnu.org/cgit/coreuti...e/src/ls.c.
M
MEEKA2002
07-05-2023, 12:29 PM #4

Determine the package it is part of, then locate its source code repository. For instance, basic tools like `ls` come from the GNU coreutils package, available at http://git.savannah.gnu.org/cgit/coreutils.git/tree/src, where you can view the file at http://git.savannah.gnu.org/cgit/coreuti...e/src/ls.c.

T
TeamFlajers
Junior Member
19
07-13-2023, 04:03 AM
#5
On a Debian-based system you can determine the package by running dpkg -S /bin/ls. This will indicate it's part of coreutils. Next, use apt-cache show coreutils to retrieve details like the homepage and source code. You can also download the package's source via apt, for example from the provided link.
T
TeamFlajers
07-13-2023, 04:03 AM #5

On a Debian-based system you can determine the package by running dpkg -S /bin/ls. This will indicate it's part of coreutils. Next, use apt-cache show coreutils to retrieve details like the homepage and source code. You can also download the package's source via apt, for example from the provided link.

R
ReeprPvP
Junior Member
13
07-13-2023, 04:36 AM
#6
Thanks a lot!
R
ReeprPvP
07-13-2023, 04:36 AM #6

Thanks a lot!

A
Adabelle
Senior Member
724
07-14-2023, 01:22 PM
#7
You're asking about specific adjustments you'd like to make. There are more straightforward options available—like creating a custom alias for "ls" or using another tool such as exa. Updating and recompiling the software isn't recommended since it could interrupt updates and cause issues with essential functions.
A
Adabelle
07-14-2023, 01:22 PM #7

You're asking about specific adjustments you'd like to make. There are more straightforward options available—like creating a custom alias for "ls" or using another tool such as exa. Updating and recompiling the software isn't recommended since it could interrupt updates and cause issues with essential functions.

C
Charliemc909
Posting Freak
898
07-17-2023, 07:42 AM
#8
I have a raspberry pi and I want it to show a message on a nokia screen right before powering off to know when it's safe to unplug it. The problem is that showing this image before executing the command won't cut it since in the case where the poweroff command takes too much time the user could unplug it without it being safe. There is a method to show the PI's status with an LED and GPIO pins but it isn't acceptable in my case. My thinking was to run the script once the bulk of the shutting down was done. If you think of a better way I'm all ears because I agree with you, mine is extremely janky... This is necessary since the screen stays on/doesn't clear once the pi shuts down.
C
Charliemc909
07-17-2023, 07:42 AM #8

I have a raspberry pi and I want it to show a message on a nokia screen right before powering off to know when it's safe to unplug it. The problem is that showing this image before executing the command won't cut it since in the case where the poweroff command takes too much time the user could unplug it without it being safe. There is a method to show the PI's status with an LED and GPIO pins but it isn't acceptable in my case. My thinking was to run the script once the bulk of the shutting down was done. If you think of a better way I'm all ears because I agree with you, mine is extremely janky... This is necessary since the screen stays on/doesn't clear once the pi shuts down.

L
Llyodsk
Member
164
07-17-2023, 09:35 AM
#9
A systemd service could help manage this. The ExecStop feature lets you execute a script when the service stops. Running it before starting ensures the script runs last, which is useful for cleanup before shutdown. This works with Raspbian, but if you're using a different init system, you'll need to adjust accordingly.
L
Llyodsk
07-17-2023, 09:35 AM #9

A systemd service could help manage this. The ExecStop feature lets you execute a script when the service stops. Running it before starting ensures the script runs last, which is useful for cleanup before shutdown. This works with Raspbian, but if you're using a different init system, you'll need to adjust accordingly.

N
NoParticles
Junior Member
19
07-19-2023, 08:54 AM
#10
I'm using raspbian. Your setup looks much neater! Regarding your question, what's the optimal order for starting services?
N
NoParticles
07-19-2023, 08:54 AM #10

I'm using raspbian. Your setup looks much neater! Regarding your question, what's the optimal order for starting services?

Pages (2): 1 2 Next