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 was trying to make a script to redo a chmod on a folder every 15min. by using crontab (*/15 * * * * /(link to script.sh)
now i didn't know much about the use of the scrips so i just write in the command i would in terminal
chmod -R 664 /data/
i try to run the script in terminal and now i can't see the files in that folder. but acording to the folder properties, i am still using the disc space where the data use to be, so the data in the folder doesn't seem to be deleted.
the main focus i want is how to get the data back. scripting and others can come later.
chmod will not make your data disapear. What makes you think your files are gone? What is the message you get when you do "ls -l" on the data directory? Paste that output here. You can restore the original permissions, if you know what they were.
Although I'm not sure exactly what your requirements are, you probably want your script to read:
chmod -R 775 /data/
which would give read/write access to the owner and group and read access to others. As said above, the execute bit is required to allow users to list the contents. If you don't want others to be able to do that then chmod the others bit to remove the execute flag, just be sure that the owner (and if applicable the group) have it set.
Below is some notes on how the numeric octal codes and how it breaks out into permissions and what it may mean if applied.
The Sum of each of these give all the permissions so 5 would be Read & execute (4+1) and 6 would be Read and write. The order in which you place them determines who gets that permission.
u-User/Owner ( 1st # - so 7 in 755)
g-Group ( 2nd # - so 5 in 755)
o-Others ( 3rd # - so second 5 in 755)
a- All ( all 3 )
r - Read permission. Whether the file may be read. In the case of a directory, this would mean the ability to list the contents of the directory.
w - Write permission. Whether the file may be written to or modified. For a directory, this defines whether you can make any changes to the contents of the directory. If write permission is not set then you will not be able to delete, rename or create a file.
x - Execute permission. Whether the file may be executed. In the case of a directory, this attribute decides whether you have permission to enter,run a search through that directory or execute some program from that directory.