Du exclude in Solaris


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Du exclude in Solaris
# 1  
Old 03-09-2016
Du exclude in Solaris

How do you exclude a filesystem using du command in solaris?

for example /proc
Tried this but its not working
Code:
du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head -


in linux it is working.
# 2  
Old 03-09-2016
The Solaris du does not have an exclude option.
You can use find. Here is the trick to not descend into further subdirectories and not into proc and .*
Code:
find / \! -name "" -prune \( \( -name proc -o -name ".*" \) -prune -o -print \)

Instead of / and "" you can use . and . if you did a cd /.
Having that, you can pipe it to xargs du , or use -exec du instead of -print like this
Code:
find / \! -name "" -prune \( \( -name proc -o -name ".*" \) -prune -o -exec du -sk -d {} \; \) | sort -nr

# 3  
Old 03-09-2016
Hi.

If you wish to have access to the GNU utilities, the code pkg-get is available: Solaris pkg-get tool

It includes a large body of the GNU codes in a repository.

Here is a sample of lines from beginning:middle:end of the available packages:
Code:
$ pkg-get available | specimen 5:5:5
Edges: 5:5:5 of 3817 lines in file "-"
#  (From site http://mirror.opencsw.org/opencsw/unstable)
           389_admin 1.1.38,REV=2015.11.20
   389_adminutil_dev 1.1.21,REV=2015.11.20
   389_admin_console 1.1.8,REV=2012.01.24
   ---
             libxext 1.1.1,REV=2010.03.08
libxfce4kbd_private2_0 4.10.0,REV=2013.09.26
          libxfce4ui 4.10.0,REV=2013.09.26
       libxfce4ui1_0 4.10.0,REV=2013.09.26
      libxfce4ui_dev 4.10.0,REV=2013.09.26
   ---
                 znc 0.206,REV=2012.05.18
             znc_dev 0.206,REV=2012.05.18
                 zsh 5.2,REV=2015.12.03
               zsync 0.6.2,REV=2013.10.22
              zutils 1.0,REV=2013.07.05

Executed with:
Code:
$ which pkg-get specimen
/opt/csw/bin/pkg-get
/export/home/drl/bin/specimen

On:
Code:
OS, ker|rel, machine: SunOS, 5.11, i86pc
Distribution        : Solaris 11.2 X86

Best wishes ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Exclude an specific directory for auditing in Solaris 10

Hello, Im glad to become a member of this forums, Im new on solaris and recentrly im introducing to use auditing service in that system. The need is, that I need how to exclude a directory to the audit service not audit it. And, a plus, I need of how to disable auditing the root user in... (0 Replies)
Discussion started by: sysh4ck
0 Replies

2. Shell Programming and Scripting

Du exclude in Solaris

How do you exclude a filesystem using du command in solaris? for example /proc Tried this but its not working du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head - (1 Reply)
Discussion started by: jinslick25
1 Replies

3. Shell Programming and Scripting

Exclude string

I would like to write a script to check the log , if any line in the log have the string in include_list.txt but do not have the string in exclude_list.txt , then send alert mail to administrator , as below example , the line 1 have the string "string 4" ( which is in include_list.txt ) but do not... (7 Replies)
Discussion started by: ust3
7 Replies

4. Shell Programming and Scripting

Exclude certain folders

Hi Experts, Below is my shell script and it will move the files older than 90 days to archive mount. Now my new requirement is , I need to move some of the directory files older than 365 days. How can I achieve this. Simply I have DIR1 DIR2 DIR3 DIR4 I need to exclude DIR 2 and DIR 2... (5 Replies)
Discussion started by: arumugavelvelu
5 Replies

5. Shell Programming and Scripting

Exclude files in ls

Hi, I need to exlucde the files which are present in exclude.txt from a directory exlcude.txt AUZ.txt AUZ.chk NZ.txt NZ.chk tried with below code but not working ls -ltr | grep -v `cat exclude.lst` (9 Replies)
Discussion started by: rohit_shinez
9 Replies

6. Shell Programming and Scripting

Little help with rsync --exclude

Loving the rsync command and beginning to write some scripts with it. However I'm hung up on the --exclude function. Script is tested and works great BEFORE I put the --omit in. What am I doing wrong in my syntax? rsync $OPTS /cis/cloverleaf/cis6.0/integrator/... (2 Replies)
Discussion started by: B_ROX
2 Replies

7. Shell Programming and Scripting

Solaris FIND: Exclude Specific Paths

Using Sol 10 + KSH. I need to run a find command on the whole system "/" and exclude a bunch of explicit directories and files that may or may not be on each system. I cannot use the -name because i dont want to exclude all dirs named just specific paths. -path/-wholename is not an option... (2 Replies)
Discussion started by: nitrobass24
2 Replies

8. Shell Programming and Scripting

Exclude a file or not in

Hi Gurus. I have a directory and i receive many files with extension .log. I processed the file as i get it. i want to process all the files except one which i know i don't want to process. cd /backup/temp/rajesh/PACS #--- directory , under this i have below files... (1 Reply)
Discussion started by: guddu_12
1 Replies

9. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

10. Shell Programming and Scripting

ls to exclude file

I have cgicsave.env and cgic*, but I want to print cgic* value but NOT cgicsave.env Thanks (9 Replies)
Discussion started by: xs2punit
9 Replies
Login or Register to Ask a Question