1
vote
1answer
15 views

i3wm amixer controls from i3status

I can run bindsym button4 exec amixer -D pulse sset Master 5%+ and bindsym button5 exec amixer -D pulse sset Master 5%- to adjust the volume from a terminal session. However when I add the commands to ...
1
vote
3answers
200 views

How come root can do this, but sudo can't? [duplicate]

I am set up as a sudoer on my Debian machine, and I use it all the time to install software etc... I came across this interesting situation that I am scratching my head about: I tried to enable the ...
4
votes
4answers
8k views

Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

This is on a Raspberry Pi. Here's the output of sudo ls -lL /sys/class/gpio/gpio18: -rwxrwx--- 1 root gpio 4096 Mar 8 10:50 active_low -rwxrwx--- 1 root gpio 4096 Mar 8 10:52 ...
0
votes
2answers
62 views

bash file permission error while appending to a file [duplicate]

I am installing Voipmonitor whose setup script has this step: sudo echo " * * * * * root php /var/www/html/php/run.php cron" >> /etc/crontab I am getting this error -bash: /etc/crontab: ...
1
vote
2answers
42 views

Send a message to a “screen” to be received by a device on /dev

My question may looks trivial... But it's because despite of my long experience of linux/unix/osx systems, I found myself lacking some basic notions. I created a little bluetooth/arduino switch to ...
3
votes
2answers
45 views

modify text file with only one number subject to constraints

I have a text file a.txt whose content is a number between 0 and 100. I need a single command which modifies a.txt by increasing by 10 the number, but under the constraint that the final result has to ...
0
votes
0answers
22 views

How can I run a command as root user on Ubuntu? [duplicate]

It seems Ubuntu has disabled the root user account so su doesnt work which is causing me an issue where I have an apache log file that is owned by root $ls -al error.log -rw-r----- 1 root adm 2061050 ...
0
votes
2answers
102 views

Bash function for piping data into protected file [duplicate]

I wanted to create a .bashrc function that would simplify passing data to a write-protected file. function pipe { sudo bash -c "$1" } Unfortunately the command pipe echo something > ...
1
vote
1answer
51 views

Not getting the desired output for echo command [duplicate]

Below is my script. #!/bin/bash SERVERS="sl20rht00-t" #SERVERS="shcbrht01-t" USR="adm-dt-c" for host in $SERVERS do ssh -tt $USR@$host 'sudo cp /etc/sudoers /Backups/sudoers_11thmarch2015; sudo cp ...
-1
votes
1answer
133 views

sudo issue during echo something to a root file [duplicate]

I have a problem, during write something into a root file: $ ll /sys/bus/usb/devices/3-2/power/wakeup -rw-r--r-- 1 root root 4096 Feb 16 17:28 /sys/bus/usb/devices/3-2/power/wakeup $ sudo echo ...
0
votes
2answers
598 views

Why can't I change the hostname of my server using sudo? [duplicate]

From a user that is part of the sudoers group, I can normally run any command by doing sudo <command> But the following command fails stating "Permission denied" sudo echo "myhostname" > ...
9
votes
7answers
1k views

Emptying a file for root user does not work [duplicate]

I use below command to empty a file > file.txt It works perfectly fine! But there are some files with root user permissions. So I tried sudo > different-file.txt and I got below verbose ...
1
vote
1answer
3k views

Why do I get “Permission denied” when redirecting the output of sudo echo “xyz” to a file? [duplicate]

Why do I get -bash: test: Permission denied when I run sudo echo "xyz" > test The directory permissions are: drwxr-xr-x 3 root root 4096 2014-08-05 16:26 I have no problem creating a ...
3
votes
2answers
8k views

How to insert text into a root-owned file using sudo? [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on Running a command like sudo echo 'text' >> /file.txt fails with: bash: /file.txt: Permission ...
15
votes
3answers
14k views

Execute a line of commands with one sudo

For example if I want to create a file and enter text in one line I can redirect the output into a file with the use of the > operator: echo "something" > /path/foobar but if I don't have ...

15 30 50 per page