Académique Documents
Professionnel Documents
Culture Documents
$visecondlongfile.txt
$vi`lst|head1` [Note:Thiswillopenthelastfileyouedited(i.esecondlongfile.txt)]
$ls1
bin
boot
cdrom
dev
etc
home
initrd
initrd.img
lib
$lsl
rwr1rameshteamdev9275204Jun1315:27mthesaur.txt.gz
1st Character File Type: First character specifies the type of the file. In the example above the hyphen (-) in the 1st character indicates that this is a normal file. Following are the possible file type options in the 1st character of the ls -l output.
Field 1 File Permissions: Next 9 character specifies the files permission. Each 3 characters refers to the read, write, execute permissions for user, group and world In this example, -rw-r indicates readwrite permission for user, read permission for group, and no permission for others.
Field 2 Number of links: Second field specifies the number of links for that file. In this example, 1 indicates only one link to this file. Field 3 Owner: Third field specifies owner of the file. In this example, this file is owned by username ramesh. Field 4 Group: Fourth field specifies the group of the file. In this example, this file belongs to teamdev group. Field 5 Size: Fifth field specifies the size of file. In this example, 9275204 indicates the file size. Field 6 Last modified date & time: Sixth field specifies the date and time of the last modification of the file. In this example, Jun 13 15:27 specifies the last modification time of the file. Field 7 File name: The last field is the name of the file. In this example, the file name is mthesaur.txt.gz.
rwr1rameshteamdev9275204Jun1215:27archlinux.txt.gz*
$lslh rwr1rameshteamdev8.9MJun1215:27archlinux.txt.gz
$lsl/etc
total3344
rwrr1rootroot15276Oct52004a2ps.cfg
rwrr1rootroot2562Oct52004a2pssite.cfg
drwxrxrx4rootroot4096Feb22007acpi
rwrr1rootroot48Feb82008adjtime
drwxrxrx4rootroot4096Feb22007alchemist
$lsld/etc drwxrxrx21rootroot4096Jun1507:02/etc
$lslt total76 drwxrwxrwt14rootroot4096Jun2207:36tmp drwxrxrx121rootroot4096Jun2207:05etc drwxrxrx13rootroot13780Jun2207:04dev drwxrxrx13rootroot4096Jun2023:12root drwxrxrx12rootroot4096Jun1808:31home drwxrxrx2rootroot4096May1721:21sbin lrwxrwxrwx1rootroot11May1720:29cdrom>media/cdrom drwx2rootroot16384May1720:29lost+found drwxrxrx15rootroot4096Jul22008var
7. Order Files Based on Last Modified Time (In Reverse Order) Using ls ltr
To sort the file names in the last modification time in reverse order. This will be showing the last edited file in the last line which will be handy when the listing goes beyond a page. This is my default ls usage. Anytime I do ls, I always use ls -ltr as I find this very convenient.
$lsltr total76 drwxrxrx15rootroot4096Jul22008var drwx2rootroot16384May1720:29lost+found lrwxrwxrwx1rootroot11May1720:29cdrom>media/cdrom drwxrxrx2rootroot4096May1721:21sbin drwxrxrx12rootroot4096Jun1808:31home drwxrxrx13rootroot4096Jun2023:12root drwxrxrx13rootroot13780Jun2207:04dev drwxrxrx121rootroot4096Jun2207:05etc drwxrwxrwt14rootroot4096Jun2207:36tmp
$lsa [rnatarajan@aspdev~]$lsa .DebianInfo.txt ..CentOSInfo.txt .bash_historyFedoraInfo.txt .bash_logout.lftp .bash_profilelibiconv1.11.tar.tar .bashrclibssh20.121.2.el4.rf.i386.rpm It will show all the files including the . (current directory) and .. (parent directory). To show the hidden files, but not the . (current directory) and .. (parent directory), use option -A.
.bashrclibssh20.121.2.el4.rf.i386.rpm [Note:.and..arenotdisplayedhere]
devicesprofiles
$lsR/etc/sysconfig/networking
/etc/sysconfig/networking:
devicesprofiles
/etc/sysconfig/networking/devices:
/etc/sysconfig/networking/profiles:
default
/etc/sysconfig/networking/profiles/default:
To show all the files recursively, use -R option. When you do this from /, it shows all the unhidden files in the whole file system recursively.
279694chargen279724cupslpd279697daytimeudp
279695chargenudp279696daytime279698echo
lsq
$lsl~/.bash_profile
rwrr1rameshramesh909Feb811:48/home/ramesh/.bash_profile
$lsn~/.bash_profile
rwrr1511511909Feb811:48/home/ramesh/.bash_profile [Note:Thisdisplay511foruidand511forgid]
$lsF
Desktop/Documents/UbuntuApp@firstfileMusic/Public/Templates/
$lscolor=auto
DesktopDocumentsExamplesfirstfileMusicPicturesPublicTemplatesVideos