Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I tried compiling a program from source but it didn't work; I wasn't that bothered, so I tried to delete the directory in /home that contained all the files relating to this program. However, Ubuntu will not permit me to delete any folders inside this directory, or the unwanted directory itself (but I can delete the files inside them) and tells me:
"main.Po" cannot be deleted because you do not have permissions to modify its parent folder.
Hmm. Can I just delete this program's main folder from my /home directory as root, or will this cause untold problems? I mean, I had to "make install" as root, so is the system expecting me to delete the unwanted folders as root too?
it seems that you complied the source as root or unpacked the tar file as root. When you do that the files are not owned by the your regular user anymore but they'll be owned by root. If the root account owns the file then you're user account doesn't have permissions to delete.
You need to open a shell do something like:
su root #Use the shell as root
password: #Type root password
cd /$FolderIWantToDeleteStuffFrom #Browse into my folder
ls -al #Make sure that what i want to delete
rm -rf * #Delete everything
su $MyUserName #Stay secure and go back to my user
that will delete all the files in that folder. The text after the # are comments for the commands in the same line. You could also use sudo to achieve the same result but i thought su explains what's going on better.
I wish you've posted your complie trail. Post errors from your compilation process.
Last edited by waelaltaqi; 02-12-2008 at 02:23 PM.
use sudo to run commands with elevated permissions and only use su - in rare cases (basically the less the better) I have a terrible habbit developed for years of su'ing to root and its being a pain to break.
the second and more serious never and I mean NEVER "rm -rf *" first change into the install dir you want to remove. "cd /usr/local/" where the "app_to_delete" dir exist. From there run "sudo rm -rf ./app_to_delete/" It looks very similar I know but never run rm -rf without the starting ./ and best done using tab completion to ensure you don't have any stray or misunderstood input. one badly placed / with a rm -rf and you will have a VERY bad day.
switch to newuser, BUT, maintain callers env eg $PATH etc
su - newuser
switch to newuser, inc newuser's env ie exactly as if you logged in as newuser.
Note that you do not
su - olduser
to get back.
Each 'su' opens a new shell from the prev one ie to get back to olduser, use 'exit' instead.
1- SU swithces completely to another user. Not recommended if you're going to do a simple administrative task. Use if you're only doing long administrative task that requires multiple commands that need root privileges.
Be carefully downloading files from the internt when you're under that user.
2- sudo let's you execute a certain command AS root.
say you're logged in as myuser and you want to delete a file from the /root folder then using sudo let's excute that single command once AS root.
OK, thanks everyone for the info and advice. At this early stage in my Linux knowledge, I think I will stick with "sudo" for those occasions when I need to execute the odd command as root. I presume once I close the shell all root privileges are terminated, and if I open another shell I start back as an ordinary user again?