Linux touch описание. Touch Программки и утилиты
Иногда ошибки TOUCH.EXE и другие системные ошибки EXE могут быть связаны с проблемами в реестре Windows. Несколько программ может использовать файл TOUCH.EXE, но когда эти программы удалены или изменены, иногда остаются "осиротевшие" (ошибочные) записи реестра EXE.
В принципе, это означает, что в то время как фактическая путь к файлу мог быть изменен, его неправильное бывшее расположение до сих пор записано в реестре Windows. Когда Windows пытается найти файл по этой некорректной ссылке (на расположение файлов на вашем компьютере), может возникнуть ошибка TOUCH.EXE. Кроме того, заражение вредоносным ПО могло повредить записи реестра, связанные с Microsoft Windows NT Server Resource Kit CD-ROM. Таким образом, эти поврежденные записи реестра EXE необходимо исправить, чтобы устранить проблему в корне.
Редактирование реестра Windows вручную с целью удаления содержащих ошибки ключей TOUCH.EXE не рекомендуется, если вы не являетесь специалистом по обслуживанию ПК. Ошибки, допущенные при редактировании реестра, могут привести к неработоспособности вашего ПК и нанести непоправимый ущерб вашей операционной системе. На самом деле, даже одна запятая, поставленная не в том месте, может воспрепятствовать загрузке компьютера!
В связи с подобным риском мы настоятельно рекомендуем использовать надежные инструменты очистки реестра, такие как %%product%% (разработанный Microsoft Gold Certified Partner), чтобы просканировать и исправить любые проблемы, связанные с TOUCH.EXE. Используя очистку реестра , вы сможете автоматизировать процесс поиска поврежденных записей реестра, ссылок на отсутствующие файлы (например, вызывающих ошибку TOUCH.EXE) и нерабочих ссылок внутри реестра. Перед каждым сканированием автоматически создается резервная копия, позволяющая отменить любые изменения одним кликом и защищающая вас от возможного повреждения компьютера. Самое приятное, что устранение ошибок реестра может резко повысить скорость и производительность системы.
Предупреждение: Если вы не являетесь опытным пользователем ПК, мы НЕ рекомендуем редактирование реестра Windows вручную. Некорректное использование Редактора реестра может привести к серьезным проблемам и потребовать переустановки Windows. Мы не гарантируем, что неполадки, являющиеся результатом неправильного использования Редактора реестра, могут быть устранены. Вы пользуетесь Редактором реестра на свой страх и риск.
Перед тем, как вручную восстанавливать реестр Windows, необходимо создать резервную копию, экспортировав часть реестра, связанную с TOUCH.EXE (например, Microsoft Windows NT Server Resource Kit CD-ROM):
- Нажмите на кнопку Начать .
- Введите "command " в строке поиска... ПОКА НЕ НАЖИМАЙТЕ ENTER !
- Удерживая клавиши CTRL-Shift на клавиатуре, нажмите ENTER .
- Будет выведено диалоговое окно для доступа.
- Нажмите Да .
- Черный ящик открывается мигающим курсором.
- Введите "regedit " и нажмите ENTER .
- В Редакторе реестра выберите ключ, связанный с TOUCH.EXE (например, Microsoft Windows NT Server Resource Kit CD-ROM), для которого требуется создать резервную копию.
- В меню Файл выберите Экспорт .
- В списке Сохранить в выберите папку, в которую вы хотите сохранить резервную копию ключа Microsoft Windows NT Server Resource Kit CD-ROM.
- В поле Имя файла введите название файла резервной копии, например "Microsoft Windows NT Server Resource Kit CD-ROM резервная копия".
- Убедитесь, что в поле Диапазон экспорта выбрано значение Выбранная ветвь .
- Нажмите Сохранить .
- Файл будет сохранен с расширением.reg .
- Теперь у вас есть резервная копия записи реестра, связанной с TOUCH.EXE.
Следующие шаги при ручном редактировании реестра не будут описаны в данной статье, так как с большой вероятностью могут привести к повреждению вашей системы. Если вы хотите получить больше информации о редактировании реестра вручную, пожалуйста, ознакомьтесь со ссылками ниже.
touch - команда Unix, созданная для установки времени последнего конфигурации файла либо доступа в настоящее время. Также употребляется для сотворения пустых файлов.
ИсторияУтилита touch появилась в операционной системе AT&T UNIX Version 7. Версия утилиты touch, которая идет в комплекте с GNU coreutils, была разработана Полом Рабином, Арнольдом Роббинсом, Джимом Кингдоном, Девидом МакКинзи и Рэнди Смитом.
СпецификацияСогласно POSIX утилита touch изменяет время последнего конфигурации либо время последнего доступа файла. Имя либо путь к файлу передается в качестве аргумента.
Если файл не существует, утилита делает пустой файл с обозначенным именованием и устанавливает время последнего конфигурации и последнего доступа в значение, переданное в качестве аргумента. Если аргумент времени не задан, употребляется текущее время.
Синтаксис командыtouch
[-acfhm] [-r файл] [-t MMDDhhmm.] файл
-a
Устанавливает время последнего доступа к файлу. Время последнего конфигурации не устанавливается, если очевидно не задан ключ -m
Указывает утилите не создавать файл, если он не существует, при всем этом никаких сообщений об ошибке показано не будет.
-f
Пытается обновить информацию о времени, даже если права доступа файла не позволяют делать.
-h
Указывает утилите не изменять данные о файле, если он задан символической ссылкой.
-m
Устанавливает время последнего конфигурации файла.
-r file
Использовать значения времени из файла, данного аргументом file .
-t time
Устанавливает время последнего конфигурации и доступа в согласовании с обозначенным форматом time .
Формат даты, обозначенный в ключе -t задается в согласовании с шаблоном [[СС]YY]MMDDhhmm[.SS] :
СС
- 1-ые две числа года (век).
Если параметр CC не задан и значение YY находится в границах Шестьдесят девять и 99, то тогда СС устанавливается равным 19,
в неприятном случае употребляется 20.
MM - двузначный номер месяца.
DD - двузначный номер денька.
hh - значение часов даты.
mm - значение минут даты.
SS - значение секунд даты.
как взломать wi-fi на андроид при помощи программы wi-fi hacker pro обзоры Давида
В различных UNIX-подобных системах синтаксис команды может отличаться. К примеру, GNU touch содержит опцию -d, которая позволяет устанавливать дату в форматах, отличающихся от упомянутого выше.
ПримерыДелает файл myfile.txt и устанавливает время последнего конфигурации и доступа в настоящее время в системе; если файл существует - обновляет время последнего конфигурации и доступа не изменяя при всем этом содержимого файла:
# touch myfile.txtУстанавливает дату последнего конфигурации и доступа в 8:46:26 30 один января Две тыщи семь г.:
# touch -t 200701310846.26 index.html # touch -d "31 Января 2007 8:46:26" index.html # touch -d "Jan 30 один 2007 8:46:26" index.html Ссылки
- touch - справочная страничка GNU coreutils
- touch - справочная страничка операционной системы OpenBSD
- Официальная спецификация touch
- Примеры использования touch
touch"s syntax is
touch file_name(s)
When used without any options , touch creates new files for any file names that are provided as arguments (i.e., input data) if files with such names do not already exist. Touch can create any number of files simultaneously.
Thus, for example, the following command would create three new, empty files named file1 , file2 and file3 :
touch file1 file2 file3
A nice feature of touch is that, in contrast to some commands such as cp (which is used to copy files and directories) and mv (which is used to move or rename files and directories), it does not automatically overwrite (i.e., erase the contents of) existing files with the same name. Rather, it merely changes the last access times for such files to the current time.
Several of touch"s options are specifically designed to allow the user to change the timestamps for files. For example, the -a option changes only the access time, while the -m option changes only the modification time. The use of both of these options together changes both the access and modification times to the current time, for example:
The -r (i.e., reference ) option followed directly by a space and then by a file name tells touch to use that file"s time stamps instead of current time. For example, the following would tell it to use the times of file4 for file5 :
The -B option modifies the timestamps by going back the specified number of seconds, and the -F option modifies the time by going forward the specified number of seconds. For example, the following command would make file7 30 seconds older than file6 .
touch -r file6 -B 30 file7
The -d and -t options allow the user to add a specific last access time. The former is followed by a string (i.e., sequence of characters) in the date, month, year, minute:second format, and the latter uses a MMDDhhmm[.ss] format. For example, to change the last access time of file8 to 10:22 a.m. May 1, 2005, 1 May 2005 10:22 would be enclosed in single quotes and used as follows, i.e.,:
Partial date-time strings can be used. For example, only the date need be provided, as shown for file9 below (in which case the time is automatically set to 0:00):
Just providing the time, as shown below, automatically changes the date to the current date:
touch -d "14:24" file9
The most commonly used way to view the last modification date for files is to use the ls command with its -l option. For example, in the case of a file named file10 this would be
The complete timestamps for any file or directory can be viewed by using the stat command. For example, the following would show the timestamps for a file named file11 :
The --help option displays a basic list of options, and the --version option returns the version of the currently installed touch program.
In Linux every single file is associated with timestamps, and every file stores the information of last access time, last modification time and last change time. So, whenever we create new file, access or modify an existing file, the timestamps of that file automatically updated.
Linux Touch Command Examples
In this article we will cover some useful practical examples of Linux touch command . The touch command is a standard program for Unix/Linux operating systems, that is used to create, change and modify timestamps of a file. Before heading up for touch command examples, please check out the following options.
Touch Command Options
- -a , change the access time only
- -c , if the file does not exist, do not create it
- -d , update the access and modification times
- -m , change the modification time only
- -r , use the access and modification times of file
- -t , creates a file using a specified time
1. How to Create an Empty File
The following touch command creates an empty (zero byte) new file called sheena .
# touch sheena
2. How to Create Multiple Files
By using touch command, you can also create more than one single file. For example the following command will create 3 files named, sheena , meena and leena .
# touch sheena meena leena
3. How to Change File Access and Modification Time
To change or update the last access and modification times of a file called leena , use the -a option as follows. The following command sets the current time and date on a file. If the leena file does not exist, it will create the new empty file with the name.
# touch -a leena
The most popular Linux commands such as and uses timestamps for listing and finding files.
4. How to Avoid Creating New File
Using -c option with touch command avoids creating new files. For example the following command will not create a file called leena if it does not exists.
# touch -c leena
5. How to Change File Modification Time
If you like to change the only modification time of a file called leena , then use the -m option with touch command. Please note it will only updates the last modification times (not the access times) of the file.
# touch -m leena
6. Explicitly Set the Access and Modification times
You can explicitly set the time using -c and -t option with touch command. The format would be as follows.
# touch -c -t YYDDHHMM leena
For example the following command sets the access and modification date and time to a file leena as 17:30 (17:30 p.m .) December 10 of the current year (2012 ).
# touch -c -t 12101730 leena
Next verify the access and modification time of file leena , with ls -l command.
7. How to Use the time stamp of another File
The following touch command with -r option, will update the time-stamp of file meena with the time-stamp of leena file. So, both the file holds the same time stamp.
# touch -r leena meena
8. Create a File using a specified time
If you would like to create a file with specified time other than the current time, then the format should be.
# touch -t YYMMDDHHMM.SS tecmint
For example the below command touch command with -t option will gives the tecmint file a time stamp of 18:30:55 p.m . on December 10 , 2012 .
# touch -t 201212101830.55 tecmint
We’ve almost covered all the options available in the touch command for more options use “man touch “. If we’ve still missed any options and you would like to include in this list, please update us via comment box.
With no options, touch will change the atime, mtime, and ctime of file to the current system time.
Options
Option | Description | ||||
---|---|---|---|---|---|
-a | Set the access time only. | ||||
-c
, --no-create |
Do not create files. | ||||
-d
datestring
, --date= datestring |
Parse the date string datestring , and use it instead of current time. Strings valid to the date command are accepted by the -d option. | ||||
-f | This option does nothing, but is accepted to provide compatibility with BSD versions of touch. | ||||
-h
, --no-dereference |
If file
is a symbolic link and this option is specified, touch
will modify the timestamp of the symlink, rather than its referenced file. If this option is not specified, touch
will dereference symlinks before making modifications. This option implies -c : nothing is created if file does not exist. |
||||
-m | Set modification time only. | ||||
-r=
reffile
, --reference= reffile |
Set the times of file
to the times of file reffile
instead of the current time. In addition to having write access, the user must also own a file to set its times to the past or future. |
||||
-t timestamp | Use the numeric timestamp
instead of the current time. The format of timestamp
is [[CC
]YY
]MMDDhhmm
[.ss
]. In addition to having write access, the user must also own a file to set its times to the past or future. |
||||
--time= timetype | An alternate way to specify what type of time to set (as with -a
and -m
). The value of timetype must be one of the following:
|
||||
--help | Display a help message, and exit. | ||||
--version | Display version information, and exit. |
Notes
The -d option takes a human-readable date string. For example, "July 4" , "4 Jul" , "0:00" , or "Jul 4 2017 00:00:00" . If year, month, or day are omitted, the current system time values are used. If the time is omitted, midnight is used. The day may be specified before or after the month in the string. Single digit numbers may be prefixed with a zero, or not, according to preference. If seconds are specified, they are to be preceded in the time by a colon (: ).
-t takes a numeric timestamp, which expresses the month, date, hour, and minute as MMDDHHMM . For example, 07040000 would be midnight on the fourth of July. Century, years, and seconds are optional, and may be specified as CCYYMMDDHHMM.SS . If seconds are specified, they are to be preceded with a period (. ).
Specifying times in the future is okay. For example, -d "Jan 1 2029" . In addition to having write access, the user must also own a file to set its times to the past or future.
Because there is no way to manually set ctimes, the -r , -d , and -t options can modify only atimes and mtimes. When a file is touched, the ctime will always be set to the current system time.
Time zones
touch -t "10310000" - > boo.txtSame as the previous command.
Examples
touch -d "1 Feb" file1.txtSet the atime and mtime of file1.txt to February 1st of the current year. The ctime is set to the current system time.
Touch -d "February 1" file1.txt
Same as the previous command.
Same as the previous command.
Touch -d "01:02" file1.txt
Set the atime and mtime of file1.txt to 1:02 AM, today.
Touch -d "1:2" file1.txt
Same as the previous command.
Touch -md "Sep 1 1927 23:58:59" file1.txt
Set the mtime of file1.txt to September 1, 1927, 11:58 PM and 59 seconds. The ctime is set to the current system time. The atime is not changed.
Examples
touch --time=01020304 file1.txtSet the atime and mtime of file1.txt to January 2, 3:04 AM of the current year. The ctime is set to the current system time.
Touch -t 01020304 file1.txt
Same as the previous command.
Touch -t 5006070405 file1.txt
Set the atime and mtime of file1.txt to June 7, 2050, 4:05 AM. The ctime is set to the current system time.
Touch -t 205007080405 file1.txt
Same as the previous command, but explicitly specifying the century (20 ).
Touch -at 195003040506.59 file1.txt
Set the atime of file1.txt to March 4, 1950, 5:06 AM and 59 seconds. The ctime is set to the current system time. The mtime is not changed.
Checking file times with stat
stat file.txt stat: cannot stat "file.txt": No such file or directory touch file.txt; stat file.txt File: "file.txt" Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 802h/2050d Inode: 668116 Links: 1 Access: (0664/-rw-rw-r--) Uid: (1001/ hope) Gid: (1002/ hope) Access: 2017-10-25 21:35:17.368254343 -0400 Modify: 2017-10-25 21:35:17.368254343 -0400 Change: 2017-10-25 21:35:17.368254343 -0400 Birth: - touch -ad "July 12 1895" file.txt; stat file.txt File: "file.txt" Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 802h/2050d Inode: 668116 Links: 1 Access: (0664/-rw-rw-r--) Uid: (1001/ hope) Gid: (1002/ hope) Access: 1895-07-12 00:00:00.000000000 -0500 Modify: 2017-10-25 21:35:17.368254343 -0400 Change: 2017-10-25 21:35:55.487636366 -0400 Birth: - touch -mt 198307010000 file.txt; stat file.txt File: "file.txt" Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 802h/2050d Inode: 668116 Links: 1 Access: (0664/-rw-rw-r--) Uid: (1001/ hope) Gid: (1002/ hope) Access: 1895-07-12 00:00:00.000000000 -0500 Modify: 1983-07-01 00:00:00.000000000 -0400 Change: 2017-10-25 21:36:59.654589018 -0400 Birth: - for formatspec in "file name:\t%n" "accessed:\t%x" "modified:\t%y" "changed:\t%z"; do stat --printf="$formatspec\n" file.txt; done file name: file.txt accessed: 1895-07-12 00:00:00.000000000 -0500 modified: 1983-07-01 00:00:00.000000000 -0400 changed: 2017-10-25 21:36:59.654589018 -0400Note: You may notice in this set of examples that when the atime was changed to July 12, 1895, the time zone changed. That"s because Daylight Savings Time (DST) was not enacted in North America until April 1, 1918.
Related commands
date
— View or set the current date and time.
stat
— Display the status of a file or filesystem.