1.

What command is used to list files or folders in alphabetical order in UNIX?

Answer»

By USING the LS command, you can list down the current DIRECTORY’s content LIKE files and folders.

Syntax: 

ls [OPTIONS] [FILES]

With no arguments and no options, ls displays a list of all files in the current working directory:

Examples:

  • List the names of the files in your current directory alphabetically
  • Command
gourav@localhost:~$ ls

Output

cache db empty games lock log mail opt spool tmp

Files are arranged in alphabetical order across as many columns as your terminal can accommodate.

  • To view all information about a files/directory
  • Command
gourav@localhost:~$ ls -l

Output

drwxr-xr-x 6 linuxer USERS 1824 Jun 9 16:46 sabon-rw------- 1 linuxer users 1064 Oct 28 14:35 music-rw------- 6 linuxer users 5119 Apr 28 16:00 splus2-rw-r--r-- 3 linuxer users 9853 Dec 27 11:14 ssh_known-rw-r--r-- 1 linuxer users 4231 Apr 21 15:23 swlist.out-rw-r--r-- 1 linuxer users 94031 Sep 14 16:07 tarnti.zip


Discussion

No Comment Found