LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 10-16-2013, 11:01 PM   #1
jjones
LQ Newbie
 
Registered: Oct 2013
Posts: 5

Rep: Reputation: Disabled
RedHat Newb-File creation


Ive totally spaced on how to create a file in the home directory. and when i do it i cant remember how to change the permissions on it either. any help would be great.
 
Old 10-16-2013, 11:12 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Create what kind of file? What will it contain?

If you just want to create an empty file you can use touch
Code:
touch ~/file
To modify the permissions you use chmod
Code:
chmod 664 ~/file

Last edited by suicidaleggroll; 10-16-2013 at 11:13 PM.
 
Old 10-16-2013, 11:20 PM   #3
jjones
LQ Newbie
 
Registered: Oct 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Create what kind of file? What will it contain?

If you just want to create an empty file you can use touch
Code:
touch ~/file
To modify the permissions you use chmod
Code:
chmod 664 ~/file

Its just a txt file. and only the owner and group can read write and execute

Last edited by jjones; 10-16-2013 at 11:21 PM.
 
Old 10-17-2013, 04:59 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Quote:
Originally Posted by jjones View Post
Its just a txt file. and only the owner and group can read write and execute

ok "touch" will create a file for you OR

Code:
cat > filename.txt
some text
ctrl+d (To save and exit)


chmod 770 location/to/the/file/filename

will give read write and execute permissions to the owner and group.
For more read out:

Code:
man cat
man chmod
man chown (for even more on permissions, ***there is still a lot more)
 
  


Reply

Tags
newbie, redhat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redhat newb with a lot of questions jjones Linux - Newbie 3 10-16-2013 03:06 PM
[SOLVED] Prevent subdirectory creation while allowing file creation bweddell Linux - Security 5 07-31-2011 09:54 PM
changing default file permissions upon file creation ceci2 Linux - Newbie 7 10-01-2009 08:27 AM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 11:36 PM
Redhat 9.0 CD creation swassink Linux - Newbie 2 07-15-2003 05:35 PM


All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration