[Discuss] root privileges [command line information]
pw
p.willis at telus.net
Fri Aug 18 18:42:50 PDT 2006
Alan W. Irwin wrote:
> On 2006-08-18 08:01-0700 SJF wrote:
>
>>
>> Below is the output (on Konsule) when I wanted to see what the order
>> of my DNS
>> search was.
>>
>> fisher at fishhead:~> su
>> Password:
>> fishhead:/home/fisher # /etc/resolv.conf
>> bash: /etc/resolv.conf: Permission denied
>> fishhead:/home/fisher #
>>
>> I don't understand why the 'permission response' comes up? Does not
>> 'su' plus
>> the password take me into root privileges? What am I missing please.
>
>
> Any time you type a name with nothing in front Linux will try to execute
> that file as a shell script or programme. Thus, you tried to execute
> /etc/resolv.conf which the system wisely restricted you from doing.
>
> Instead, look at that file (e.g., less /etc/resolv.conf).
>
> Alan
> __________________________
> Alan W. Irwin
Hello,
I'm not sure what level you are able to use the command line at
so please don't feel insulted if most of what I write is
old news for you.
If you're a beginner on the command line it can be a bit
abstract compared to a graphical user interfaces with a mouse.
The linux text command line works by typing a command and then the
inputs for that command, all on one line and then pressing the 'Enter'
key.
Say you want to copy a file into another file using the 'cp' (copy)
command; you would type
cp source_file destination_file
For example if I want to make a copy of a file named 'input.txt' to
a file named 'output.txt', I would type:
cp input.txt output.txt
The command line also allows you to redirect input from one command
into a file or alternately into another program. As an example of this
let's use the 'echo' command. The command just echos text back to the
screen.
echo "testing 123" <enter>
testing 123
Let's redirect that output into a file.
echo "testing 123" > myfile.txt
Notice that we used the '>' symbol to direct the output
from the 'echo' command into the file named 'myfile.txt'.
Now if you want to look list 'myfile.txt' to the screen
you can use the 'cat' (catalogue) command.
cat myfile.txt
testing 123
You cn also redirect the output of one program into another program.
echo "testing 123" | sed -e "s/123/456/g"
testing 456
Here we have 'piped' the output from the echo command into the
sed (serial editor) command. The sed command is performing a
global search and replace of the text '123' by the text '456'.
Notice that we use the '|' character to redirect into other
programs.
The most common commands and programs used for viewing and editing files
from the linux command line are:
ls used to list available files
cat used to dump the contents of files to the screen
less used to view files without editing (scrolls both up and down)
vi used to edit files
emacs also used to edit files and to communicate with the
'great overlords' on planet-X.
(You must wear a foil hat to use emacs by law)
The 'info' command is useful for finding information about
other commands. For example if we want information about the 'vi'
editor program.
info vi
This brings up info pages for the viper editor program.
(press 'q' to return to the command line)
'man' (manual) pages are also a good source of information.
Many programs are installed with manual pages.
man vi
This brings up the manual page vi.
(press 'q' to return to the command line)
There is a limited linux commandline 'cheat sheet' located at:
http://www.pixelbeat.org/cmdline.html
Peter
More information about the Discuss
mailing list