Any UNIX command to defragment?

Hello Apple Discussions Community.
I would like to know if there is, same as "fsck -fy" to repair the HD, any UNIX command on Verbose Mode to optimize or defragment the Hard Drive. Thanks.

Limnos wrote:
OSX doesn't come with a defragment utility.
That is not entirely correct.
OS X continuously and automatically defragments files under 20MB. If you have many files larger than that, you can use a utility such as iDefrag. However, many say that the best and fastest way to defragment a large volume of large files is to back up, erase volume, restore volume. This is definitely a lot easier and faster than running a defragmentation utility. Possibly safer too, as extended defragmentation sessions can really hammer your hard disk heads.
Also, you may want to read this article that describes why the obsession with defragmentation in other file systems doesn't always apply to OS X, because of the efficient way OS X writes to disk in the first place. That combined with OS X auto-defragmentation means there is a lot less reason to defrag in OS X.
It mentions the sheer folly of running a defrag utility for several hours in order to speed up disk access time by a few seconds total. So, you saved how much time?

Similar Messages

  • Any unix commands to view network status & activity using the terminal?

    I don't use the terminal much and was wondering if there are any unix network commands that let you view packet contents, connection status and other network information. I'm not interested in making any changes, I just want to use the terminal to get network and related information.
    Thanks in advance to anybody who answers.
    - Mark
    G4/450MHz Sawtooth   Mac OS X (10.4.7)  

    Hi Mark,
       There are tons of commands; it would help to know what you want to know. You can monitor the status of all ports with:
    sudo lsof +Mi
    That will display all network connections and all listening daemons. A command that is similar to that is:
    netstat -a -f inet
    Of course netstat specializes in network information and there are lots of different stats it will display.
       If you run a firewall, it keeps stats on rule matches. You can see them with:
    sudo ipfw -atdN list
       As has already been mentioned, Mac OS X comes with tcpdump but there's only one great packet sniffer: Ethereal. It doesn't come with OS X but if you have X11, it can be installed with a packet manager like Fink.
       Finally, many running services keep their own stats or logs. You would have to read up on the ones you're running to see what information they provide.
    Gary
    ~~~~
       A diplomat is man who always remembers a woman's
       birthday but never her age.
             -- Robert Frost

  • Issueing unix command from java

    I am using FTPConnection.java by Bret Taylor, for uploading files to remote linux portal. But i cannot issue any unix command from it . please anyone help me in this case?

    Read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    It'll explain it all. - MOD

  • UNIX command in ABAP code

    Hi All,
    I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
    Can any one help with how to used unix commands in ABAP?
    Thanks in advance.
    Regards,
    Hemendra

    The recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc.  For example:
    Command name       OS         Type             OS command                                 Parameters for operating system command 
    Z_FILE_MOVE        SunOS      Customer    mv                                                 ? ?   
    You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
    Jonathan

  • How to generate a empty file in AL11 using ABAP and unix command

    Hi Experts,
    when load infopackage triggers it will search file from AL11 if file is available it will get loaded successfully.  When there is no file in AL11 error while opening file (orgin A) and the load will fail.  At this level i have to write a abap code using unix command to generate a empty file.
    Is there any way to achieve the above requirement.
    Thanks
    Vara

    Hi,
    If i get your requirement properly then you want to create a blank file if there is no file on the application server so that your infopackage does not fail, am i correct.
    If this is your requirement then this can be easily done if you use process chain to load the file via infopackage. Follow the following steps:
    1. Add a ABAP program before the infopackage and check if the file is present on the server or not. Use a simple ABAP statement OPEN DATASET <FNAME>. Check the SY-SUBRC after this statement if it is not 0 then it means that the file does not exist on the application server.
    2. Once you have established that the file is not present create a flat file using a code similar to the below one
    OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
                          MESSAGE D_MSG_TEXT.
    IF SY-SUBRC NE 0.
      WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
      EXIT.
    ENDIF.
    * Transferring Data
    LOOP AT INT_table.
      TRANSFER INT_table-field1 TO FILENAME.
    ENDLOOP.
    * Closing the File
    CLOSE DATASET FILENAME.
    3. Add your infopackage step after this ABAP program in your process chain.
    I hope this helps.
    Best Regards,
    Kush Kashyap

  • "at" UNIX Command in Java Program

    Friends,
    1. "at" command in UNIX execute Unix command at a scheduled time. 2. For each user there will be a table maintained internally which can be accessed by "at" with "-l" argument.
    3. A mail will be sent to the owner with the output of the commands as a message.
    I tried to run the "at" command of Unix in JSP, which gets succesfully executed in Oracle 10g App Server container (Installed in Solaris machine). I have tested the successful execution of command with the log file. But I haven't got any mail for the output. If anyone had any idea, please help me.
    The code I have wtitten is
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(new String[] {"sh","-c","at 2115 Dec 7 < /export/home/usr1/abc.sh"});
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    logger.info("<ERROR>");
    while ( (line = br.readLine()) != null)
    logger.info(line);
    logger.info("</ERROR>");
    int exitVal = proc.waitFor();
    logger.info("Process exitValue: " + exitVal);
    My doubts are:
    1. Who is the owner of the output of "at"command, which gets executed under Oracle 10g App Server container?
    2. If no one is the owner, then where will the output of "at" command will go?
    3. Is there any other way to execute "at" command of UNIX in java program? If so, then please help me.
    Thanks in advance.
    regards
    Nandha Kumar.M

    filestream I have to ask - what's a chav ?
    I have doubts abut what it is :-)
    Seriously though, what is that an abbreviation for?
    That's a new one to me.
    http://www.chavscum.co.uk
    chavs are roughly analogous to rednecksI wouldn't use that analogy. While both may lack certain social graces, rednecks typically don't receive ASBOs.
    Chavs favor small cars with lots of bling whereas rednecks are likely to drive a pickup or a large sedan.
    Chavs have pitbulls in their yards (gardens), rednecks an '84 Mustang LX on cinder blocks.
    etc, etc.
    Message was edited by:
    filestream
    Message was edited by:
    filestream

  • Unix command in ARD to remove DNS Servers from Network prefs?

    I need to know how to send a unix command to remove DNS Servers in Network preferences. I need the DNS Servers field to be blank. Can this be done?

    Our network administrator is getting ready to change the IP address of our DNS server. This means I have over 30 Macs that will be needing changes to their DNS settings. Since each machine is setup with limited access to the system prefs, that means I have to go to each machine and log in as the admin user to make this change. In the interest of saving time, is this something I can do with Remote Desktop and how? Would I use the same commands in this post and replace dns1 with our DNS' new IP address? Will this distrupt the users access to the network when I do so?
    Thanks for any help.
    Beth

  • Using Unix command lines in java code

    I was wondering if there was a way to run a unix command in java code. I know in C++ there is popen, but i don't know of a way in java. The command i need to run is the whois "domain name" command. Any help would be great!
    jarad

    try something like this:
      public static String whois(String domain) throws IOException {
        BufferedReader is = null;
        Process p = null;
        String result = "";
        p = Runtime.getRuntime().exec("whois " + domain);
        is = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line;
        while((line = is.readLine()) != null)
          result += line;
        return result;
      }

  • How to execute unix command from ODI Procedure

    Hi,
    I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
    cd /project3/tmt/;ls *.dmp > dmplist.lst
    Please help me on this...
    Thanks
    MT

    Hi nahlikh,
    Thank you for the reply.
    I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
    OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
    as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
    any thoughts appreciated to get a solution for this issue.
    Thanks
    MT

  • URGENT!! problems with Unix command, please help

    I am trying to use the following Unix command and I keep getting error messaages from stdError. However if I run the same command from the command line it works perfectly. For some reason when I run the command from inside the program it thinks the append symbol ">>" is another file.
    String command = " cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist ";
    Process p = Runtime.getRuntime().exec(command);
    The error get is :
    /bin/cat: >>: No such file or directory
    Any help would be greatly appreciated

    The better solution for this problem is write a shell script for the action you wnat to perform and execute it using the runtime.exec().In your case just cut and paste cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist in to a file and save it. use that file as a argument for the exec method it will work.
    cheers
    R.Karuna

  • Unix Command doesn't work in Tiger

    Hi,
    I've got labs of eMacs that I'm finally upgrading to Tiger. My image seems to work fine, but I'm running into a weird quirk with my "Send Unix" commands via ARD. We're doing NWEA testing and LOVE the unix commands because we can login to machines, turn on TestTaker, login to TestTaker, and select the correct test (math or reading) and the right version of the test.
    The script below works fine on a panther eMac.
    osascript
    tell application "System Events"
    keystroke "1" using command down
    delay 3.0
    keystroke ASCII character 31
    delay 2.0
    keystroke return
    keystroke "n" using command down
    end tell
    On my Tiger machines, the command stops on the:
    "Keystroke ASCII character 31" line (this should arrow down to next test version).
    A report window comes up in ARD with this error message:
    86:104: execution error: System Events got an error: 31 doesn't understand the ASCII character message. (-1708)
    This used to work perfectly, but now I can't get ASCII 31 (or arrow down to work). The real killer is that other techs in my school district have eMacs running tiger with same commands that work (some have to arrow down 16 times to get to correct test version). The other commands (like command 1 and returns, command n) all work fine! Hate to have to touch 80 machines each day to select proper test version when we log in.
    Any Suggestions????

    Try this form of the line:
    keystroke (ASCII character of 31)
    That's worked for some people. Hope it works for you. If it doesn't work as given, try without the parentheses.
    Regards.

  • Having trouble in running a unix command and getting the output

    Hi,
    I am trying to run a unix command from within the java code. I am not able to make it work. I am enclosing the code and the error message that I am getting. Any help is highly appreciated.
    import java.io.*;
    public class RunCommand {
        public static void main(String args[]) {
            String s = null;
            try {
                Process p = Runtime.getRuntime().exec("cat UNIX_ASCII_TEXT_FILE | A_UNIX_PROGRAM -d");
                BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
                BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
                // read the output from the command
                System.out.println("Here is the standard output of the command:\n");
                while ((s = stdInput.readLine()) != null) {
                    System.out.println(s);
                // read any errors from the attempted command
                System.out.println("Here is the standard error of the command (if any):\n");
                while ((s = stdError.readLine()) != null) {
                    System.out.println(s);
                System.exit(0);
            catch (IOException e) {
                System.out.println("exception happened - here's what I know: ");
                e.printStackTrace();
                System.exit(-1);
    }The error message that I am getting is
    Here is the standard output of the command:
    SLu|%%$$=
    Here is the standard error of the command (if any):
    cat: cannot open |
    cat: cannot open A_UNIX_PROGRAM
    cat: cannot open -dLooks like the cat command is working and not the pipe command and the command after the pipe. But when I run the UNIX command from the command prompt I get the expected result.

    You might read this article and see if its approach works.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to change order of network ports - unix command in Apple Remote Desktop

    I am trying to do a report of 130 machines and I want the IP addresses included in the report. When I do the report a bunch of them are missing because the only selection is "Primary Network IP" but on many of the machines the order of the network connections is such that PPP is the top and therefor primary connection
    Do you know of a unix command I can send to change the network order so that en0 is primary on all machines?

    Hi Brian
    Issue this command:
    sudo networksetup -listnetworkserviceorder
    This will list the current service order as well as giving you an idea of what name to use for each Service. For example en0 will be Ethernet; en1 will be Airport; fw0 will be Firewire and Bluetooth will be Bluetooth DUN.
    To change the order so as Ethernet will be first rather than Bluetooth for example, followed by Airport, Firewire and Bluetooth issue this command:
    sudo networksetup -ordernetworservices Ethernet Airport Firewire "Bluetooth DUN"
    That should be it. Any Service that has a space within the name has to be escaped hence the double quotes. If you want to change the order to something else then alter the Service order to suit. To see a full list of available commands issue:
    networksetup -help
    Tony

  • Unix Command run successfully through PL/SQL but showing no impact in UNIX.

    Hi,
    I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C.
    I created a shared lib (libextproc.so) for the following function.
    int sysrun(char *command)
    return system(command);
    This function runs fine when caled through a driver function in C, meaning that the shared lib is fine.
    In PL/SQL, I have used the following method to invoke a UNIX command:-
    create or replace library shell_lib as '/home/ECETRAonsite/oracle/OraHome1/lib/libextproc.so';
    create or replace function sysrun (syscomm in varchar2)
    return binary_integer
    as language C
    name "sysrun"
    library shell_lib
    parameters(syscomm string);
    Now when I call this PL/SQL function to invoke the command, it is run succesfully but does not create the file.
    SQL>
    1 declare
    2 rc number;
    3 begin
    4 rc := sysrun('/bin/touch /home/ECETRAonsite/oracle/OraHome1/test/sach');
    5 dbms_output.put_line('Return Code='||rc);
    6* end;
    SQL> /
    Return Code=0
    PL/SQL procedure successfully completed.
    I have verified that the path for 'touch' is correct.
    Following are my configuration files.
    listener.ora
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST =172.21.161.69 )(PORT = 1521)(KEY = ECTPRF))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = extproc2)
    (ORACLE_HOME = /home/ECETRAonsite/oracle/OraHome1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ANY")
    (SID_DESC =
    (SID_NAME = ECTPRF)
    (ORACLE_HOME = /home/ECETRAonsite/oracle/OraHome1)
    (ENVS = "EXTPROC_DLLS=ANY")
    tnsnames.ora
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = extproc2)
    Please suggest what is lacking for this to work properly.
    Thanks,

    No need to create a C wrapper for that kernel call. Simply call the kernel SYSTEM() call direct.
    The following works using 10.2.0.1 on HP-UX.
    SQL> create or replace library libc as 'libc.2';
    2 /
    Library created.
    SQL>
    SQL>
    SQL> create or replace function system( command IN string ) return binary_integer is
    2 EXTERNAL
    3 LIBRARY libc
    4 NAME "system"
    5 LANGUAGE C
    6 CALLING STANDARD C
    7 PARAMETERS (
    8 command STRING
    9 );
    10 /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL> -- remove the test file
    SQL> ! rm /tmp/plsql-test
    SQL>
    SQL> declare
    2 rc integer;
    3 begin
    4 rc := system( '/usr/bin/touch /tmp/plsql-test' );
    5 DBMS_OUTPUT.put_line( 'return code='||rc );
    6 end;
    7 /
    return code=0
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL>
    SQL> -- display the test file
    SQL> ! ls -l /tmp/plsql-test
    -rw-r----- 1 oracle dba 0 May 17 14:36 /tmp/plsql-test
    SQL>
    You may need to define a different library on yours. The kernel shared lib is suppose to be libc.sl - for a reason I cannot recall anymore, I've changed it to use libc.2.
    Oh yeah - the system call will be without any environment. Thus you cannot rely on any standard shell environment variables like PATH - you need to fully qualify executables and files (i.e. include the path).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Send a Unix command through ARD that will change a OS X admin user to a standard user.

    I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
    sudo dscl . -delete /Groups/admin GroupMembership USERNAME
    which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.

    I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
    dscl . -delete /Groups/admin GroupMembership ARDusername
    or
    dscl . -append /Groups/admin GroupMembership ARDusername
    What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
    dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
    By the way the '/' doesn't work in the syntax in ARD.
    Thanks

Maybe you are looking for

  • I accidentally hid the menu toolbar, now I can't find an option to unhide it, HELP!

    I was trying to hide some pesky tool bars, I clicked view, then I clicked a toolbar to hide, I hid the wrong one, I hid the menu tool bar. Now I am totally stuck! I don't know what version firefox, because the information is in the tool bar I hid. I

  • IMessage on iPad and Mac not working since 9/9/14

    Hello! All of a sudden, iMessage stopped working since 9/9/14. So here is the weird thing. It is working on my iPhone 5S, BUT I cannot send any iMessages to my mother in Austria. The weird thing is, my mother still can send iMessages to other friends

  • No of Connections

    Hi All,         I have a WAS 6.40 SP11 server running in production.Now we have generic requirement to support some 40,000 individual users maximum.I want to know whether my server is capable of withstanding the load.Else what is do be done for suppo

  • Time of creation of MIRO document

    Hi all How to view the time of a particular MIRO document when it was raised?? Regards, Ram

  • Verizon Customer Care EPIC FAIL!!!! An hour I'll NEVER get back

    Got a new phone for my birthday, Optimus 2.  automated system would not allow activation unless i buy a $45 a month plan, i want to pay by the minute.  Was told about a month ago over the phone by a customer care rep named Megan that we could use the