 |
|
Oracle Tips by Burleson |
File Commands - create an
empty file
You may find it useful to create an empty file as a placeholder
for future content. The touch command can be used without
any options to create an empty file as follows:
Directory:~
$ touch /home/tclark/touch1.fil create file touch1.fil
Directory:~
$ touch touch2.fil create file
touch2.fil
Directory:~
$ ls –l list the files
total 4
drwxrwxr-x 2 tclark tclark 4096 Jan 13 17:48
examples
-rw-rw-r-- 1 tclark tclark 0 Jan 13 19:13
touch1.fil
-rw-rw-r-- 1 tclark tclark 0 Jan 13 19:14
touch2.fil
Directory:~
$
The touch command also has an option that allows you to
change the file timestamp information using the –t option. In
the following example we will change the timestamp on the
touch1.fil above to January 10 12:00 (01101200).
Directory:~
$ touch -t 01101200 touch1.fil change timestamp to 01101200
(01/10 12:00)
Directory:~
$ ls -l
total 4
drwxrwxr-x 2 tclark tclark 4096 Jan 13 17:48
examples
-rw-rw-r-- 1 tclark tclark 0 Jan 10 12:00
touch1.fil
-rw-rw-r-- 1 tclark tclark 0 Jan 13 19:14
touch2.fil
Directory:~
$
The above book excerpt is from:
Easy Linux
Commands
Working Examples of Linux Command Syntax
ISBN:
0-9759135-0-6
Terry Clark
http://www.rampant-books.com/book_2005_1_linux_commands.htm |