- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- touch command is not working
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 05:41 AM
тАО11-27-2008 05:41 AM
When I create files the touch command is not working It is showing error
$ touch aa a2
touch: aa cannot create
touch: a2 cannot create
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 05:45 AM
тАО11-27-2008 05:45 AM
SolutionThe filesystem in which you're trying to create these files is read only for whatever reason. That's the issue you need to troubleshoot.
For instance:
cd /tmp
touch aa a2
will work.
HTH;
Doug O'Leary
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 05:48 AM
тАО11-27-2008 05:48 AM
Re: touch command is not working
The directory in which you are trying to touch the files does not have write permission for the user you logged in.
Simply go to the users home directory and touch it. it will work.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 05:50 AM
тАО11-27-2008 05:50 AM
Re: touch command is not working
It's working fine in the /tmp. why? I logged in my userid.
I want to know one more I create one more user.
There Iam trying to create a file with touch. then it shows error like.
$ touch a
touch: cannot change times on a
why these are showing these errors? Can you explain about both.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 05:59 AM
тАО11-27-2008 05:59 AM
Re: touch command is not working
You need to provide much details to help you better.
How did you created new user? SAM or command line?
if it is command line, you need to create home directory for that user manually and change the ownership to that user.
just provide "id" output for that user and "ll -d
It is a permission issue only.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 06:04 AM
тАО11-27-2008 06:04 AM
Re: touch command is not working
Dear Anjaneyulu,
I thing the exact problem is in user writes or file system problem,which it's readable file system.
that time you are not able to create the file.
not in /tmp,where ever you want it will create above mentioned things are changed.
Regards,
Unixguy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 06:04 AM
тАО11-27-2008 06:04 AM
Re: touch command is not working
cd ..
ll -d dirname (where dirname is the name of the directory).
Does the user have write permission to the directory?
2. Go back into the directory ( cd - ) and type:
ll aa
ll a2
Do the files already exist? If so, does the user have write permissions to them?
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 06:21 AM
тАО11-27-2008 06:21 AM
Re: touch command is not working
whoami -> gives your user name
groups -> gives your group(s)
pwd -> gives your actual directory
ls -ld
Permissions: drwxrwx--- says:
d - its a directory
first rwx - r(ead)w(rite)(e)x(ecute) permissions for the owner
second rwx - same for the group
third rwx (or here ---) permissions for the 'wourld' (i.e. anybody else) here: no permissions
So if you don't have 'w' you can't 'touch' a file.
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 06:34 AM
тАО11-27-2008 06:34 AM
Re: touch command is not working
>touch: cannot change times on a
Maybe there's no time zone defined for the user?
What hardware/os are you testing?
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 07:04 AM
тАО11-27-2008 07:04 AM
Re: touch command is not working
HP-UX (and Unix in general) have 3 categories for ownership (and therefore permissions). The owner, members of a group, and all others. Every file has 2 separate permission controls, one for the content of the file, and one for the content of the directory. File permissions control the data inside the file (read, write), and directory permissions control the existence (touch, rm, mv) of the file.
So if you are an ordinary user (not root) then you cannot touch or create or remove a file in the /etc directory because your user ID has no write permissions in that directory.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 12:25 PM
тАО11-27-2008 12:25 PM
Re: touch command is not working
This is partially incorrect. You can change the timestamp on the file if you have write permission on the file.
>Mark: cd ..
>ll -d dirname
>2. Go back into the directory
No need to do cd twice. Simply:
ll -d .
>Volkmar: whoami -> gives your user name
id(1) also gives you your user and group IDs.
>Maybe there's no time zone defined for the user?
Not hardly. It refers to permission problems changing the time to "now".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 02:26 PM
тАО11-27-2008 02:26 PM
Re: touch command is not working
It should be "drwx", if "w" is missing you cannot create / modify anything in that directory. If you are sure to have user have write permissions use the chown command. Refer the manpage at:
http://docs.hp.com/en/B3921-90010/chown.1.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2008 12:28 AM
тАО11-28-2008 12:28 AM
Re: touch command is not working
ok Anjaneyulu, that means for your question:
>$ touch a
>touch: cannot change times on a
The file 'a' exists, but you don't have write permissions to this file.
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2008 12:45 AM
тАО11-28-2008 12:45 AM
Re: touch command is not working
Didn't Mark and I say that? :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2008 01:39 AM
тАО11-28-2008 01:39 AM
Re: touch command is not working
Maybe it was quite obvious for you?
For me it was new so I had to test it :-)
V.