Editing
Solaris 10 Associate
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== ls command examples ==== View non-hidden contents of directory: <pre>$ ls /export/home/paul dir1 dir2 local.cshrc local.profile symbolic_file dir1_files dir3 local.login script $</pre> View long listing of non-hidden contents of directory: <pre>$ ls -l /export/home/paul total 14 drwxr-xr-x 3 paul cops 512 May 5 12:36 dir1 -rw-r--r-- 1 paul cops 180 May 5 15:47 dir1_files drwxr-xr-x 2 paul cops 512 May 5 12:34 dir2 drwxr-xr-x 2 paul cops 512 May 5 12:34 dir3 -rw-r--r-- 1 paul cops 136 May 4 09:51 local.cshrc -rw-r--r-- 1 paul cops 157 May 4 09:51 local.login -rw-r--r-- 1 paul cops 174 May 4 09:51 local.profile -rwxr--r-- 1 paul cops 0 May 5 12:56 script -rw-r--r-- 1 paul cops 0 May 5 12:34 symbolic_file $</pre> View long listing of all contents of directory: <pre>$ ls -la /export/home/paul total 22 drwxr-xr-x 5 paul cops 512 May 6 09:17 . drwxr-xr-x 6 root root 512 May 6 09:15 .. -rw-r--r-- 1 paul cops 144 May 6 09:15 .profile -rw------- 1 paul cops 14 May 6 09:15 .sh_history drwxr-xr-x 3 paul cops 512 May 5 12:36 dir1 -rw-r--r-- 1 paul cops 180 May 5 15:47 dir1_files drwxr-xr-x 2 paul cops 512 May 5 12:34 dir2 drwxr-xr-x 2 paul cops 512 May 5 12:34 dir3 -rw-r--r-- 1 paul cops 136 May 4 09:51 local.cshrc -rw-r--r-- 1 paul cops 157 May 4 09:51 local.login -rw-r--r-- 1 paul cops 174 May 4 09:51 local.profile -rwxr--r-- 1 paul cops 0 May 5 12:56 script -rw-r--r-- 1 paul cops 0 May 5 12:34 symbolic_file $</pre> Example using -d on directory, -d is useful if you want to only see directories specified as argument (versus contents of directory), more useful if combined with -l option: <pre>$ ls -d /export/home/paul /export/home/paul $ ls /export/home/paul dir1 dir2 local.cshrc local.profile symbolic_file dir1_files dir3 local.login script $</pre> Example using -d with -l option together in addition to using two arguments with one ls command: <pre>$ ls -ld /export/home/paul drwxr-xr-x 5 paul cops 512 May 6 09:17 /export/home/paul $</pre> Example of recursively listing subdirectories & contents: <pre>$ ls -R /export/home/paul /export/home/paul: dir1 dir2 local.cshrc local.profile symbolic_file dir1_files dir3 local.login script /export/home/paul/dir1: file1 file2 file3 subdir1 /export/home/paul/dir1/subdir1: subfile1 subfile2 subfile3 /export/home/paul/dir2: /export/home/paul/dir3: $</pre> '''The -F option shows file types''' Example using -F option: <pre>$ ls -F /export/home/paul dir1/ dir2/ local.cshrc local.profile symbolic_file@ dir1_files dir3/ local.login script* $</pre> Example using -FR options together: <pre>$ ls -FR /export/home/paul /export/home/paul: dir1/ dir2/ local.cshrc local.profile symbolic_file@ dir1_files dir3/ local.login script* /export/home/paul/dir1: file1 file2 file3 subdir1/ /export/home/paul/dir1/subdir1: subfile1 subfile2 subfile3 /export/home/paul/dir2: /export/home/paul/dir3: $</pre>
Summary:
Please note that all contributions to GotOpinion may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
GotOpinion:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information