Where do we have to put a linux command? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I just coded a script in bash on Ubuntu but I don't know where I should put it...
I read I had to put it in /usr/bin in a tutorial but maybe it's better directly in /bin ?

This is the difference between both directories:
/bin
It contains commands that can be used by both the system administrator and the users, but which are necessary when other file systems are not mounted (for example, in single user mode). It can also contain commands that scripts use indirectly
/usr/bin/
This is the main directory of executable commands in the system.
Therefore, it will work on both, but you must establish what responsibility your script has.

Related

How to alias or rename a file on the fly in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have the following challenge under Linux:
An application is writing a config-file "samename.cfg" into certain directories
I want to have the config-file named different for each directory
I do not want any file called "samename.cfg" written to the directories
I can not change it in the application
So I would like to have the application thinking that it accesses samename.cfg but in fact it reads and writes anothername.cfg. Symlink does not help, because then there still is a file called samename.cfg in every directory.
Anybody any idea?
Regards,
Axel
Try using a hard link instead of a soft link when using ln command (just remove the -s flag).
See ln man's page for more details.

IS there any way to find what commands we have run in linux apart from history [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
IS there any way to find what commands we have run in linux server apart from history command
is there any log file where i can see what are commands i have run
unfortunately my ~/.bash_history is clear
On linux distributions and installations I encountered: no, it's not possible. Even .bash_history is storing only bash history (and some administrators can (and will) use other shell(s)) and has usually set a limit so sometimes gets truncated. You would have to write and configure such utility yourself.

Linux How to execute a command when a certain type of file is modified? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I would like to execute "lessc ~/less/app.less > ~/stylesheets/styles.css" everytime I modify a .less file on my machine. Is it possible ?
If you are looking for a generic approach, Linux kernel has a feature called inotify that monitors file system changes.
You will have to write a small program to make use of the interface. inotify has bindings for all major languages, including perl and python .
Take a look at incron, a crontab-like system for inotify. You can set up rules to trigger any commands you want, based on events in the filesystem.

Can't copy file as root in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using Cent-OS and I am trying to copy a file. I su to root first, then I execute:
cp test.txt /usr/java/jdk1.7.0_45/jre/lib/management
But I get an input/output error. Why can't I copy this file as root? Is there something that can lock a folder in Linux so root can't change it?
root is a concept to get around the system's permissions.
IO error is a more physical problem that could be of a much more varied nature. Common examples included faulty media, unreadable CDs, lost connection, and so on.

Trying to find out why I lost my file system on Ubuntu 11.04 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I recently made the following (i believe important) changes to my system
Actually I was following this tutorial to use something called Linux Containers.
So can you tell me if any of the following stuff is capable enough to crash my system ?
1. Making changes to /etc/fstab or
2. mount /cgroup which will try to mount cgroups automatically or
3 making changes to etc/network/interfaces or
4 making changes to /etc/resolv.conf
A typo in fstab can definitely make a system un-bootable. However, you should be able to boot from CD, mount the HD, and fix it.

Resources