- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /dev/null
Operating System - HP-UX
1822158
Members
3543
Online
109640
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО10-12-2010 08:49 AM
тАО10-12-2010 08:49 AM
/dev/null
what does /dev/null refer to.
cp /dev/null > file name --- nullifies the data and set to zero size file.
whether it sets to zero size or it resides some where else???
what is the use in using /dev/null
2.dd if=/dev/rdsk/cxtydz of=/dev/null bs=1024
what does it refer to ??
cp /dev/null > file name --- nullifies the data and set to zero size file.
whether it sets to zero size or it resides some where else???
what is the use in using /dev/null
2.dd if=/dev/rdsk/cxtydz of=/dev/null bs=1024
what does it refer to ??
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2010 08:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2010 08:54 AM
тАО10-12-2010 08:54 AM
Re: /dev/null
"cp /dev/null > file name" will null out a file, that is, set it to zero size. The same can be accomplished through file redirection as "> file name".
In your second case dd is being used to test a device for readability, reading in the entire disk without actually seeing the contents. The output file being set to /dev/null simply ignores the output.
Pete
Pete
In your second case dd is being used to test a device for readability, reading in the entire disk without actually seeing the contents. The output file being set to /dev/null simply ignores the output.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2010 08:58 AM
тАО10-12-2010 08:58 AM
Re: /dev/null
Hi:
The device file '/dev/null' returns nothing as it's name suggests. The shell redirection operator (the '>') says open for output and truncate any file that exists, setting the end-of-file pointer to a zero-offset.
These are all the same:
# cp /dev/null myfile
# cat /dev/null > myfile
# > myfile
That last is a shorthand method.
As for :
# dd if=/dev/rdsk/cxtydz of=/dev/null bs=1024
This says use the '/dev/rdsk/cxtydz' device as the input file ('if'); read it; and write whatever is written to the output file '/dev/null'. Nothing is actually stored on disk; rather the I/O is down-the-drain. The 'bs=1024' says to use a physical read size (block) of 1024 characters.
Normally the above would be 'bs=1024k' for performance. The use of the *raw* device file keeps LVM buffering from needlessly being applied. The command is used to test a disk for readability.
Regards!
...JRF...
The device file '/dev/null' returns nothing as it's name suggests. The shell redirection operator (the '>') says open for output and truncate any file that exists, setting the end-of-file pointer to a zero-offset.
These are all the same:
# cp /dev/null myfile
# cat /dev/null > myfile
# > myfile
That last is a shorthand method.
As for :
# dd if=/dev/rdsk/cxtydz of=/dev/null bs=1024
This says use the '/dev/rdsk/cxtydz' device as the input file ('if'); read it; and write whatever is written to the output file '/dev/null'. Nothing is actually stored on disk; rather the I/O is down-the-drain. The 'bs=1024' says to use a physical read size (block) of 1024 characters.
Normally the above would be 'bs=1024k' for performance. The use of the *raw* device file keeps LVM buffering from needlessly being applied. The command is used to test a disk for readability.
Regards!
...JRF...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP