It will show all the files including the ‘.’ (current directory) and ‘.’ (parent directory). Hidden files in Unix starts with ‘.’ in its file name. To show all the hidden files in the directory, use ‘-a option’. Display Hidden Files Using ls -a (or) ls -A $ ls -ltrĭrwxrwxrwt 14 root root 4096 Jun 22 07:36 tmp 8. Anytime I do ls, I always use ls -ltr as I find this very convenient. This will be showing the last edited file in the last line which will be handy when the listing goes beyond a page. To sort the file names in the last modification time in reverse order. Order Files Based on Last Modified Time (In Reverse Order) Using ls -ltr Lrwxrwxrwx 1 root root 11 May 17 20:29 cdrom -> media/cdromĭrwx- 2 root root 16384 May 17 20:29 lost+foundĭrwxr-xr-x 15 root root 4096 var 7. You will be finding it handy to use it in combination with -l option. To sort the file names displayed in the order of last modification time use the -t option. Order Files Based on Last Modified Time Using ls -lt But, if you want to display the information about the /etc/ directory, use -ld option as shown below. But if you want the details of directory then you can use -d option as., For example, if you use ls -l /etc will display all the files under etc directory. When you use “ls -l” you will get the details of directories content. Display Directory Information Using ls -ld Use ls -lh (h stands for human readable form), to display file size in easy to read format. Display File Size in Human Readable Format Using ls -lh
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |