Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What are the commands lines used to display "file time creation ,last saved ,date acquired and date archived" ?

user-image
Question ajoutée par Utilisateur supprimé
Date de publication: 2014/10/13
Emad Mohammed said abdalla
par Emad Mohammed said abdalla , ERP & IT Software, operation general manager . , AL DOHA Company

 

i had a very large file in my linux dedicated server i leased from www.webune.com and i wanted to see what were the last list, it was an error log file and it was huge, but opening would mean i would have to wait a while just to see the last lines. well, linux being such a wonderful operating system, it has the tail command so to see the last10 lines on my error log file all i had to do is send this command in the linux shell and it would get and show me the last ten lines:

CODE: tail error_log.txt

hey wait a minute, what about if you wanted to display the last15 lines?well you can do that with tail: this is how you would display them:CODE:

tail -15 error_log.txt

you can change15 to whatever number of lines you want

Hrishikesh PA
par Hrishikesh PA , UNIX SME , Infosys

In linux servers, you can use the following command,

 

--

stat filename

--

 

Ex:

 

$ stat test.php 

File: `test.php'  Size:13379           Blocks:28         IO Block:4096   regular file

Device:15h/21d Inode:  Links:1

Access: (0644/-rw-r--r--)  Uid: (1944/hrishikesh)   Gid: (1100/pivusers)

Access:::33:40. +0530

Modify:::33:40. +0530

Change:::33:40. +0530

Muhammad Anzar
par Muhammad Anzar , DevOps/DevSecOps Architect , Confidential

dir command with switch options will give file time creation, last saved, last writen, archive.

 

Following switch providing time related stuff

[time] /T: the time field to display & use for sorting /T:C Creation /T:A Last Access /T:W Last Written (default) [file_attributes] /A: /A:D Folder /A:-D NOT Folder /A:R Read-only /A:-R NOT Read-only /A:H Hidden /A:-H NOT Hidden /A:A Archive /A:-A NOT Archive /A Show all files Several attributes may be combined e.g. /A:HD-R

Examples: 

 dir /A:A /T:C

Ahmad Ghieth
par Ahmad Ghieth , Technical Manager , Ambience Jordanian Lighting

in order to get mentioned details in at once, you will need to create batch or script, but you can get one at a time as below

 

dir /4 /T:C

dir /4 /T:Adir /4 /T:W

 

   /T:C   Creation date   /T:A   Last Access date   /T:W   Last Written date (default)

 

hope this was helpful