Linked Questions

4
votes
4answers
731 views

where should I put the sudo in this command? [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on echo "some words" >> /etc/apt/source.list permission denied sudo echo "some words" >> ...
7
votes
7answers
254 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 ...
8
votes
2answers
862 views

How do I append text to a write protected file [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I am trying to append a line of text to a write protected file. I tried to accomplish this with sudo ...
1
vote
2answers
3k 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 ...
3
votes
3answers
957 views

How do I use redirection with sudo [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on Yeah I could (and probably will) just escalate to root, but I'd like to know why this doesn't work? ...
2
votes
1answer
432 views

Why can I copy files to, but not create files in, this directory? [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I'm trying to create an md5sum for an ISO image created with the Ubuntu Customization Kit tools. The ...
1
vote
3answers
3k views

permission denied when redirecting sudo sed output [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I'm trying to install drupal according to the instructions given in this tutorial: ...
3
votes
2answers
481 views

insert text in a file using echo command [duplicate]

I am trying to insert some text in a file in the following way sudo echo "abc-abc/abc/abc" >> /etc/portage/make.conf but it give me the error Permission denied although I am using sudo ...
2
votes
1answer
626 views

Can't edit /proc/sys/net/core/wmem_max [duplicate]

Recently my wireless network has being stopping to transfer data from some irregular time intervals that vary from 30 seconds to 20 minutes, and every time I need to plug off and then on the wireless ...
0
votes
1answer
602 views

Script with root permission [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I am creating a script to change the brightness of my laptop. I discovered that I can do this using ...
0
votes
1answer
430 views

sudo here-document / concatenation? [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I'm new i'm trying to learn shell scripting. Is there a way to force a concatenation and override ...
1
vote
1answer
161 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 ...
0
votes
2answers
50 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" > ...
0
votes
1answer
43 views

Write a file in /var/lib/sysnews/ [duplicate]

In that folder are stored the news files: they can be created by the system administrator to write some informations for the users, as suggested in this link. I tried as a normal user to add a file ...
0
votes
0answers
50 views

Root user can't do everything? [duplicate]

Possible Duplicate: Redirecting stdout to a file you don’t have write permission on I'm quite new to Linux and I have a permissions questions. I'm using Linux Mint. If I go to /opt and do ...
0
votes
0answers
14 views

Permission denied when trying to write to a file in /sys directory [duplicate]

I'm trying to manually set the speed of the fan on my Macbook Pro 7.1 which is running Crunchbang Linux Waldorf. I'm following the instructions in this blog article ...
11
votes
4answers
6k views

How to redirect stderr,out to different files and also display in terminal?

To make it clear, I want to see the output of a command in the terminal as if there were no redirection. Also stderr need to be redirected to err.log and stdout need to be redirected to stdout.log. ...
7
votes
4answers
2k views

sudo permission denied but su grants permission

this is the first occurrence where su was required for me. I read an article about changing the value in /sys/devices/virtual/backlight/acpi_video0/brightness to alter my laptop's screen brightness. ...
5
votes
2answers
6k views

tail program output to file in Linux

I know we can use below format to redirect the screen output to a file: $ your_program > /tmp/output.txt However when I used below command, it says "-bash: /home/user/errors.txt: Permission ...
9
votes
3answers
2k 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 ...
7
votes
3answers
6k views

bash: /dev/stderr: Permission denied

After upgrading to a new release version, my bash scripts start spitting errors: bash: /dev/stderr: Permission denied in previous versions Bash would internally recognize those file names (which is ...
6
votes
1answer
3k views

Why can't sudo redirect stdout to /etc/file, but sudo 'nano' or 'cp' can?

Why does redirection, using sudo give me an error for the following commands? $ sudo printf "foo" >/etc/file bash: /etc/file: Permission denied $ sudo printf "foo" ~/file; cat ~file ...
2
votes
4answers
2k 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 ...
2
votes
3answers
2k views

Using sudo in openSUSE without actually changing to root user (i.e., like in Ubuntu)

I recently started trying openSUSE 12.3 after having used Ubuntu for a few years. I'm still getting used to openSUSE's treatment of su (and sudo) vs. Ubuntu's use of sudo. I've been reading the ...
3
votes
1answer
1k views

Ubuntu 11.04 and large external drives

I have a Hitachi USB external 3 terabyte drive attached to a Dell Precision T1500. When connected to the computer running Ubuntu 11.04 (2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 ...
3
votes
1answer
329 views

Redirecting output in the shell, permissions

I have a question about permissions. Distro: Debian GNU/Linux 6.0.4 (squeeze) So I have a folder with a php script in it. Both folder and file are owned by User1 If I do this: php script.php I ...