Latest web development tutorials

Linux ls command

Linux ls command

Linux command Daquan Linux command Daquan

Content under the specified working directory (the current working directory lists the files and subdirectories contained in it) Linux ls command displays.

grammar

 ls [-alrtAFR] [name...]

Parameters:

  • -a Show all files and directories (ls default file name or directory name is the beginning. "" treated as hidden files are not listed)
  • -l In addition to the file name, and will also file type, permissions, owner, file size and other information detailing
  • -r file will display in the reverse order (initially in alphabetical order)
  • -t The files are listed by the order of set-up time
  • -A With -a, but does not list "." (Current directory) and ".." (parent directory)
  • -F After the file name that is listed plus a symbol; for example, the executable file is with "*", then add the directory "/"
  • -R If there are files in the directory, the following files are listed in order Yijie

Examples

Listed in the root directory (\) all directories:

# ls /
bin               dev   lib         media  net   root     srv  upload  www
boot              etc   lib64       misc   opt   sbin     sys  usr
home  lost+found  mnt    proc  selinux  tmp  var

Under the current working directory lists the names of all the files beginning with s, the new back row more:

ls -ltr s*

The / bin directory of all of the following directories and files listed in the details:

ls -lR /bin

List all files and directories under the current working directory; directory name after adding to the "/" after the name of the executable file to add "*":

ls -AF

Linux command Daquan Linux command Daquan