 |
|
The UNIX ls command - list files Oracle Tips by Burleson Consulting
|
The UNIX ls command
The UNIX ls command is one of the most frequently used UNIX
commands. Without any arguments, the ls command will show us a list
of all files in our current directory:
root> ls
Mailbox invalid.sql run_rpt.ksh
ad.sql kill_oracle_sessions.ksh run_trunc.lst
adamf_techeops l.ksh run_trunc.sql
admin list.lst schools.dmp
afiedt.buf list2.lst scripts
arsd.dmp lockee.txt sql
bksel.lst lst.lst sqlnet.log
When we add the –a and –l arguments, we can see all of the details
for each file in out current working directory:
root> ls -al
total 928188
drwxr-xr-x 21 oracle dba 2048 Aug 22 20:47 .
drwxr-xr-x 10 root root 512 Jul 26 08:49 ..
-rw------- 1 oracle qmail 437 Aug 12 20:43 .bash_history
drwxr-xr-x 11 oracle qmail 512 Sep 3 2000 .dt
-rwxr-xr-x 1 oracle qmail 4381 Jul 16 13:20 .profile
-rwxr-xr-x 1 oracle qmail 3648 Sep 1 2000 .profile_old
-rw------- 1 oracle dba 2264 Sep 3 08:06 .sh_history
drwxr-xr-x 2 oracle dba 512 May 10 11:10 .ssh
-rw------- 1 oracle dba 3861 May 29 06:03 Mailbox
-rw-r--r-- 1 oracle dba 12632 Apr 11 16:09 ad.sql
drwxr-xr-x 2 oracle dba 512 Jan 26 2001 adamf_techeops
drwxr-xr-x 5 oracle dba 512 Sep 4 2000 admin
-rwxr-xr-x 1 oracle dba 55 Aug 22 11:56 afiedt.buf
Let’s take a look at each of the columns in the ls –al command so we
understand their meaning.
Column
Data
1
file permissions
3
file owner
4
file group
5
file size
6
last modified date
7
file name
The UNIX ls
command
Another very
frequently used UNIX command is the ls command.
Without any arguments, the ls command will show a list of
all files in the current directory:
root> ls
Mailbox
invalid.sql
run_rpt.ksh
ad.sql
kill_oracle_sessions.ksh
run_trunc.lst
adamf_techeops
l.ksh
run_trunc.sql
admin
list.lst
schools.dmp
afiedt.buf
list2.lst
scripts
arsd.dmp
lockee.txt
sql
bksel.lst
lst.lst
sqlnet.log
When the –a and –l
arguments are added, all of the details for each file in the
current working directory are shown:
root> ls –al
total 928188
drwxr-xr-x 21 oracle
dba 2048
Aug 22 20:47 .
drwxr-xr-x 10 root
root
512 Jul 26 08:49 ..
-rw-------
1 oracle
qmail
437 Aug 12 20:43 .bash_history
drwxr-xr-x 11 oracle
qmail
512 Sep
3
2000 .dt
-rwxr-xr-x
1 oracle
qmail
4381 Jul 16 13:20 .profile
-rwxr-xr-x
1 oracle
qmail
3648 Sep
1
2000 .profile_old
-rw-------
1 oracle
dba
2264 Sep 3
08:06 .sh_history
drwxr-xr-x 2
oracle dba
512 May 10 11:10 .ssh
-rw-------
1 oracle
dba
3861 May 29 06:03 Mailbox
-rw-r--r--
1 oracle
dba
12632 Apr 11 16:09 ad.sql
drwxr-xr-x 2
oracle dba
512 Jan 26
2001
adamf_techeops
drwxr-xr-x 5
oracle dba
512 Sep
4
2000 admin
-rwxr-xr-x
1 oracle
dba
55 Aug 22 11:56 afiedt.buf
Below is a listing
of each of the columns in the ls –al command so their meaning is
understood.
Column
|
Data
|
1
|
File
permissions
|
3
|
file owner
|
4
|
file group
|
5
|
file size
|
6
|
last
modified date
|
7
|
file name
|
Table 2.5:
The Columns in the ls –al UNIX Command
The first column
in the ls –al command shows the file permissions.
The permissions are a set of letters arranged in a group of
three, one for the file owner, one for the file group and another
for the world (Figure 1-3).
The third and fourth columns of the
ls –al
command lists the owner and group of the file.
Note that if there is super-user authority (root), change
the owner and group of any file with the
chown
command. The fifth column is the
file size in bytes, the sixth column lists the last modified date
and the last column is the name of the file.
|
|
|
Get the Complete
Oracle Utility Information
The landmark book
"Advanced Oracle
Utilities The Definitive Reference" contains over 600 pages of
filled with valuable information on Oracle's secret utilities.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|
|
|
|